Ejemplo n.º 1
0
 public function __construct($additionalChars = '', $config = [])
 {
     parent::__construct($config);
     if (!is_string($additionalChars)) {
         throw new ValidateException('Invalid list of additional characters to be loaded');
     }
     $this->params['additionalChars'] = $additionalChars;
 }
Ejemplo n.º 2
0
 public function __construct($min = null, $max = null, $inclusive = false, $config = [])
 {
     if (!is_null($min) && !is_null($max) && $min > $max) {
         throw new ValidateException(sprintf('%s cannot be less than  %s for validation', $min, $max));
     }
     parent::__construct($config);
     $this->params['minValue'] = $min;
     $this->params['maxValue'] = $max;
     $this->params['inclusive'] = $inclusive;
 }
Ejemplo n.º 3
0
 public function __construct($min = null, $max = null, $inclusive = false, $config = [])
 {
     parent::__construct($config);
     if (!is_null($min) && !is_null($max) && $min > $max) {
         throw new ValidateException(sprintf('%s cannot be less than  %s for validation', $min, $max));
     }
     $this->params['minValue'] = \rock\helpers\FileHelper::sizeToBytes($min);
     $this->params['maxValue'] = \rock\helpers\FileHelper::sizeToBytes($max);
     $this->params['inclusive'] = $inclusive;
 }
Ejemplo n.º 4
0
 public function __construct($mimeTypes, $config = [])
 {
     parent::__construct($config);
     $this->params['mimeTypes'] = $this->toArray($mimeTypes);
 }
Ejemplo n.º 5
0
 public function __construct($minValue, $inclusive = false, $config = [])
 {
     parent::__construct($config);
     $this->params['minValue'] = FileHelper::sizeToBytes($minValue);
     $this->params['inclusive'] = $inclusive;
 }
Ejemplo n.º 6
0
 public function __construct($format = null, $config = [])
 {
     parent::__construct($config);
     $this->params['format'] = $format;
 }
Ejemplo n.º 7
0
 public function __construct($extensions, $checkExtensionByMimeType = true, $config = [])
 {
     parent::__construct($config);
     $this->params['extensions'] = $this->toArray($extensions);
     $this->params['checkExtensionByMimeType'] = $checkExtensionByMimeType;
 }
Ejemplo n.º 8
0
 public function __construct($range = null, $options = null, $config = [])
 {
     parent::__construct($config);
     $this->params = ['range' => $this->parseRange($range), 'options' => $options];
 }
Ejemplo n.º 9
0
 public function __construct($maxValue = null, $inclusive = false, $config = [])
 {
     parent::__construct($config);
     $this->params['maxValue'] = class_exists('rock\\file\\UploadedFile') ? UploadedFile::getSizeLimit($maxValue) : FileHelper::sizeToBytes(ini_get('upload_max_filesize'));
     $this->params['inclusive'] = $inclusive;
 }