__construct() public method

Setup validation
public __construct ( array $data, array $fields = [], string $lang = null, string $langDir = null )
$data array
$fields array
$lang string
$langDir string
コード例 #1
0
 /** Create a new server-side validator.
  *
  * @param RequestSchema $schema A RequestSchema object, containing the validation rules.
  * @param MessageTranslator $translator A MessageTranslator to be used to translate message ids found in the schema.
  */
 public function __construct($schema, $translator)
 {
     // Set schema
     $this->setSchema($schema);
     // Set translator
     $this->_translator = $translator;
     // TODO: use locale of translator to determine Valitron language?
     // Construct the parent with an empty data array.
     parent::__construct([]);
 }
コード例 #2
0
ファイル: Validator.php プロジェクト: h8h8h8h/swoole
 public function __construct($data, $fields = array(), $lang = null, $langDir = null)
 {
     parent::__construct($data, $fields, 'zh-cn', $langDir);
 }
コード例 #3
0
ファイル: ExtendedValidator.php プロジェクト: maksimru/pingyo
 function __construct($input)
 {
     if (is_callable('parent::__construct')) {
         parent::__construct($input);
     }
 }