getParsedBody(); if (empty($data->id)) { throw new BadRequest(); } $this->getEmailFolderService()->moveUp($data->id); return true; } /** * @throws BadRequest * @throws Forbidden * @throws Error * @throws NotFound */ public function postActionMoveDown(Request $request): bool { $data = $request->getParsedBody(); if (empty($data->id)) { throw new BadRequest(); } $this->getEmailFolderService()->moveDown($data->id); return true; } /** * @throws Forbidden * @throws NotFound */ public function getActionListAll(Request $request): stdClass { $userId = $request->getQueryParam('userId'); $list = $this->getEmailFolderService()->listAll($userId); return (object) ['list' => $list]; } private function getEmailFolderService(): Service { return $this->injectableFactory->create(Service::class); } }