Beispiel #1
0
 /** The procedure for the validation attributes before post changes */
 public function validate()
 {
     if ($this->_scenario == self::SC_INSERT) {
         if ($this->_uploadedFile->hasError()) {
             $this->addError('fileid', _('Upload error, try again later.'));
         }
         if ($this->getSizeMb() > (double) App::getAppC()['maxUploadMb']) {
             $this->addError('fileid', sprintf(_('The max file at Mb for upload is %s MB'), App::getAppC()['maxUploadMb']));
         }
     }
 }
Beispiel #2
0
 /**
  * @return bool
  */
 public function isUserFilesLimit()
 {
     return $this->files_count >= App::getAppC()['maxCountFiles'];
 }