Example #1
0
 public function insertFileAction()
 {
     $file = new File();
     $file->setDescription($this->app->request->post('description'));
     try {
         $file = $this->app->dataAccessorFactory->getDataAccessor(EntityNames::FILE)->insert($file);
     } catch (EntityNotInsertedException $enie) {
         ResponseFactory::createErrorJsonResponse($this->app, HttpStatusCodes::CONFLICT, $enie->getMessage());
         return;
     }
     ResponseFactory::createJsonResponse($this->app, $file);
 }