Esempio n. 1
0
 protected function processImageUpdate($entityId, $entity)
 {
     $file = $this->getRequest()->files->all();
     reset($file);
     $file = current($file);
     $fileController = new FileController();
     $fileController->setContainer($this->getContainer());
     $config = FileConfiguration::getImageConfig();
     $errors = $this->processImage($fileController, $file, $entityId, $entity, $config);
     if (!empty($errors)) {
         throw new HttpException(500, json_encode($errors), null, ["Content-Type" => "application/json"]);
     }
 }
Esempio n. 2
0
 /**
  * Manage how a image collection has to be saved
  *
  * @param int    $parentId   Parent id owning images being saved
  * @param string $parentType Parent Type owning images being saved
  *
  * @return Response
  */
 public function saveImageAjaxAction($parentId, $parentType)
 {
     $config = FileConfiguration::getImageConfig();
     return $this->saveFileAjaxAction($parentId, $parentType, $config['objectType'], $config['validMimeTypes'], $config['extBlackList']);
 }