Exemplo n.º 1
0
 public function getFileByIdAction($id)
 {
     try {
         ResponseFactory::createJsonResponse($this->app, $this->app->dataAccessorFactory->getDataAccessor(EntityNames::FILE)->getById($id));
     } catch (EntityNotFoundException $enfe) {
         ResponseFactory::createNotFoundResponse($this->app, $enfe->getMessage());
     }
 }
 public function deleteArticleCategoryByIdAction($id)
 {
     try {
         $this->app->dataAccessorFactory->getDataAccessor(EntityNames::ARTICLE_CATEGORY)->delete($id);
     } catch (EntityNotFoundException $enfe) {
         ResponseFactory::createNotFoundResponse($this->app, 'Could not find article category');
         return;
     }
     $this->app->response->setStatus(HttpStatusCodes::NO_CONTENT);
 }
Exemplo n.º 3
0
 public function deletePageCategoryByIdAction($id)
 {
     try {
         $this->app->dataAccessorFactory->getDataAccessor(EntityNames::PAGE_CATEGORY)->delete($id);
     } catch (EntityNotFoundException $enfe) {
         ResponseFactory::createNotFoundResponse($this->app, $enfe->getMessage());
         return;
     }
     $this->app->response->setStatus(HttpStatusCodes::NO_CONTENT);
 }
Exemplo n.º 4
0
 public function deleteEventByIdAction($id)
 {
     try {
         $this->app->dataAccessorFactory->getDataAccessor(EntityNames::EVENT)->delete($id);
     } catch (EntityNotFoundException $enfe) {
         ResponseFactory::createNotFoundResponse($this->app, 'Could not find eventt');
         return;
     }
     $this->app->response->setStatus(HttpStatusCodes::NO_CONTENT);
 }
Exemplo n.º 5
0
 public function deleteRepeatOptionByIdAction($id)
 {
     try {
         $this->app->dataAccessorFactory->getDataAccessor(EntityNames::REPEAT_OPTION)->delete($id);
     } catch (EntityNotFoundException $enfe) {
         ResponseFactory::createNotFoundResponse($this->app, $enfe->getMessage());
         return;
     } catch (EntityNotDeletedException $ende) {
         ResponseFactory::createErrorJsonResponse($this->app, HttpStatusCodes::CONFLICT, $ende->getMessage());
         return;
     }
     $this->app->response->setStatus(HttpStatusCodes::NO_CONTENT);
 }
Exemplo n.º 6
0
 public function deleteArticleByIdAction($id)
 {
     try {
         $this->app->dataAccessorFactory->getDataAccessor(EntityNames::ARTICLE)->delete($id);
     } catch (EntityNotFoundException $enfe) {
         ResponseFactory::createNotFoundResponse($this->app, 'Could not find article');
         return;
     } catch (EntityNotDeletedException $ende) {
         ResponseFactory::createErrorJsonResponse($this->app, HttpStatusCodes::CONFLICT, $ende->getMessage());
         return;
     }
     $this->app->response->setStatus(HttpStatusCodes::NO_CONTENT);
 }