Example #1
0
 public function validateFileInformation()
 {
     $bExists = SystemDbExists::getInstance()->validateField(FileInformation::className(), 'id', $this->fileInformationId);
     if (!$bExists) {
         $this->addError('fileInformationId', 'FILE_NOT_EXISTS');
     }
 }
 /**
  * @return self
  */
 private function _init()
 {
     $this->_objFileInformation = $this->_objRoundSaveThumb->getFileInformation()->one();
     $this->_objFile = $this->_objFileInformation->getFile()->one();
     $this->_objThumbsCategory = $this->_objRoundSaveThumb->getThumbsCategory()->one();
     $this->_basePath = Module::getInstance()->params['file']['BASE_DIR'];
     $this->_originalFilePath = $this->_objFile->getFilePath();
     $this->_fileExtention = image_type_to_extension($this->_objFile->getType());
     $pattern = '#(.*\\/)' . Module::getInstance()->params['file']['FILE_ORIGINAL_NAME'] . '\\.#ui';
     preg_match($pattern, $this->_originalFilePath, $arrSaveDir);
     $this->_thumbFileSaveDir = $arrSaveDir[1];
     return $this;
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getFileInformation()
 {
     return $this->hasOne(FileInformation::className(), ['id' => 'file_information_id']);
 }
Example #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getFileInformations()
 {
     return $this->hasMany(FileInformation::className(), ['id' => 'file_information_id'])->viaTable('image_album2file_information', ['album_id' => 'id']);
 }
Example #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getImageFileInformations()
 {
     return $this->hasMany(FileInformation::className(), ['file_id' => 'id']);
 }