/** * @Route("/set_admin") * @Method({"POST"}) * * @return array */ public function set_admin(Request $request) { if (!$this->isAdmin()) { return ['error' => true, 'errorText' => 'accessDenied']; } $id = $request->request->get('id'); $result = $this->authorservice->set_admin($id); return $result; }
/** * @Route("/get_categoryPeople/{catId}/{catPage}/{maxPagePeople}", requirements={"catId" = "\d+"}) * @Method({"GET"}) */ public function get_categoryPeople($catId, $catPage, $maxPagePeople) { $qposts = $this->postcategoryservice->getPostsByAuthorCategory($catId, $catPage, $maxPagePeople); $author = $this->authorservice->getAuthorsByIds($qposts['result']); return ['peoples' => $author, 'peoplesCount' => $qposts['count_all']]; }
/** * @Route("/save") * @Method({"POST"}) */ public function save(Request $request) { $model = $request->request->get('model'); return $this->service->save($model); }