service = $service; $this->userId = $UserId; } /** * @NoAdminRequired */ public function favorites() { return new DataResponse($this->service->findAll($this->userId)); } /** * @NoAdminRequired * * @param string $title * @param string $content */ public function fav($id) { return $this->service->create($id, $this->userId); } /** * @NoAdminRequired * * @param int $id */ public function unfav($id) { return $this->handleNotFound(function () use ($id) { return $this->service->delete($id, $this->userId); }); } }