Example #1
0
 /**
  * @param string $attribute
  */
 public function validateFileInformationId($attribute)
 {
     $manager = new FileInformationManager();
     if (!$manager->isExist($this->{$attribute})) {
         $this->addError($attribute, $attribute . ' not exist');
     }
 }
Example #2
0
 /**
  * @param UploadForm $form
  * @param integer $thumbsCategoryId
  * @throws ErrorException
  * @return \ImageMS\models\File\Information\FileInformation
  */
 private function _uploadFromMemeberForm(UploadForm $form, $thumbsCategoryId = null)
 {
     $fileInformationManager = new FileInformationManager();
     /* @var $fileInformationData \ImageMS\models\File\Information\FileInformationData */
     $fileInformationData = $fileInformationManager->getObjectData();
     $fileInformationData->loadFromMemberForm($form);
     $fileInformationData->thumbs_category_id = $thumbsCategoryId;
     $fileInformationRow = $fileInformationManager->uploadImage($fileInformationData, $form->getImageContent());
     return $fileInformationRow;
 }