예제 #1
0
 /**
  * Add a rule to the rules array
  * The rule needs to be completely configured before adding it to the array
  *
  * @param AbstractValidator $rule Rule object
  * @param string $fieldName Field name the rule belongs to
  * @param bool $breakOnError Break the rule chain when TRUE
  * @return \TYPO3\CMS\Form\Utility\ValidatorUtility
  */
 public function addRule(AbstractValidator $rule, $fieldName, $breakOnError = FALSE)
 {
     $prefix = $this->getPrefix();
     $this->rules[$prefix][] = array('instance' => (object) $rule, 'fieldName' => (string) $fieldName, 'breakOnError' => (bool) $breakOnError);
     if ($rule->messageMustBeDisplayed()) {
         if (!isset($this->messages[$prefix][$fieldName])) {
             $this->messages[$prefix][$fieldName] = array();
         }
         end($this->rules[$prefix]);
         $key = key($this->rules[$prefix]);
         $message = $rule->getMessage();
         $this->messages[$prefix][$fieldName][$key][$key + 1] = $message['cObj'];
         $this->messages[$prefix][$fieldName][$key][$key + 1 . '.'] = $message['cObj.'];
     }
     return $this;
 }
예제 #2
0
 /**
  * Constructor
  *
  * @param array $arguments Typoscript configuration
  * @return void
  */
 public function __construct($arguments)
 {
     $this->setFormat($arguments['format']);
     parent::__construct($arguments);
 }
예제 #3
0
 /**
  * Constructor
  *
  * @param array $arguments Typoscript configuration
  */
 public function __construct($arguments)
 {
     $this->setField($arguments['field']);
     parent::__construct($arguments);
 }
예제 #4
0
 /**
  * Constructor
  *
  * @param array $arguments Typoscript configuration
  * @return void
  */
 public function __construct($arguments)
 {
     $this->setRegularExpression($arguments['expression']);
     parent::__construct($arguments);
 }
 /**
  * Constructor
  *
  * @param array $arguments Typoscript configuration
  */
 public function __construct($arguments)
 {
     $this->setMaximum($arguments['maximum']);
     parent::__construct($arguments);
 }
 /**
  * Constructor
  *
  * @param array $arguments Typoscript configuration
  * @return void
  */
 public function __construct($arguments)
 {
     $this->setAllowedTypes($arguments['types']);
     parent::__construct($arguments);
 }
예제 #7
0
 /**
  * Constructor
  *
  * @param array $arguments Typoscript configuration
  */
 public function __construct($arguments = array())
 {
     $this->setAllowWhiteSpace($arguments['allowWhiteSpace']);
     parent::__construct($arguments);
 }
예제 #8
0
 /**
  * Constructor
  *
  * @param array $arguments Typoscript configuration
  */
 public function __construct($arguments)
 {
     $this->charsetConverter = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Charset\CharsetConverter::class);
     $this->setMinimum($arguments['minimum'])->setMaximum($arguments['maximum']);
     parent::__construct($arguments);
 }
예제 #9
0
 /**
  * Constructor
  *
  * @param array $arguments Typoscript configuration
  */
 public function __construct($arguments)
 {
     $this->setMinimum($arguments['minimum'])->setMaximum($arguments['maximum'])->setInclusive($arguments['inclusive']);
     parent::__construct($arguments);
 }
예제 #10
0
 /**
  * Constructor
  *
  * @param array $arguments Typoscript configuration
  */
 public function __construct($arguments)
 {
     $this->setArray($arguments['array.'])->setStrict($arguments['strict']);
     parent::__construct($arguments);
 }