本文整理汇总了PHP中CValidator::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP CValidator::__construct方法的具体用法?PHP CValidator::__construct怎么用?PHP CValidator::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CValidator
的用法示例。
在下文中一共展示了CValidator::__construct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(array $options = array())
{
parent::__construct($options);
$valueTypesAll = array(ITEM_VALUE_TYPE_FLOAT => true, ITEM_VALUE_TYPE_UINT64 => true, ITEM_VALUE_TYPE_STR => true, ITEM_VALUE_TYPE_TEXT => true, ITEM_VALUE_TYPE_LOG => true);
$valueTypesNum = array(ITEM_VALUE_TYPE_FLOAT => true, ITEM_VALUE_TYPE_UINT64 => true);
$valueTypesChar = array(ITEM_VALUE_TYPE_STR => true, ITEM_VALUE_TYPE_TEXT => true, ITEM_VALUE_TYPE_LOG => true);
$valueTypesLog = array(ITEM_VALUE_TYPE_LOG => true);
$valueTypesInt = array(ITEM_VALUE_TYPE_UINT64 => true);
$argsIgnored = array(array('type' => 'str'));
$this->allowed = array('abschange' => array('args' => $argsIgnored, 'value_types' => $valueTypesAll), 'avg' => array('args' => array(array('type' => 'sec_num', 'mandat' => true), array('type' => 'sec_zero', 'can_be_empty' => true)), 'value_types' => $valueTypesNum), 'band' => array('args' => array(array('type' => 'sec_num_zero', 'mandat' => true, 'can_be_empty' => true), array('type' => 'num', 'mandat' => true), array('type' => 'sec_zero', 'can_be_empty' => true)), 'value_types' => $valueTypesInt), 'change' => array('args' => $argsIgnored, 'value_types' => $valueTypesAll), 'count' => array('args' => array(array('type' => 'sec_num', 'mandat' => true), array('type' => 'str'), array('type' => 'operation'), array('type' => 'sec_zero', 'can_be_empty' => true)), 'value_types' => $valueTypesAll), 'date' => array('args' => $argsIgnored, 'value_types' => $valueTypesAll), 'dayofmonth' => array('args' => $argsIgnored, 'value_types' => $valueTypesAll), 'dayofweek' => array('args' => $argsIgnored, 'value_types' => $valueTypesAll), 'delta' => array('args' => array(array('type' => 'sec_num', 'mandat' => true), array('type' => 'sec_zero', 'can_be_empty' => true)), 'value_types' => $valueTypesNum), 'diff' => array('args' => $argsIgnored, 'value_types' => $valueTypesAll), 'fuzzytime' => array('args' => array(array('type' => 'sec_zero', 'mandat' => true)), 'value_types' => $valueTypesNum), 'iregexp' => array('args' => array(array('type' => 'str', 'mandat' => true), array('type' => 'sec_num', 'can_be_empty' => true)), 'value_types' => $valueTypesChar), 'last' => array('args' => array(array('type' => 'sec_num_zero', 'mandat' => true, 'can_be_empty' => true), array('type' => 'sec_zero', 'can_be_empty' => true)), 'value_types' => $valueTypesAll), 'logeventid' => array('args' => array(array('type' => 'str', 'mandat' => true)), 'value_types' => $valueTypesLog), 'logseverity' => array('args' => $argsIgnored, 'value_types' => $valueTypesLog), 'logsource' => array('args' => array(array('type' => 'str', 'mandat' => true)), 'value_types' => $valueTypesLog), 'max' => array('args' => array(array('type' => 'sec_num', 'mandat' => true), array('type' => 'sec_zero', 'can_be_empty' => true)), 'value_types' => $valueTypesNum), 'min' => array('args' => array(array('type' => 'sec_num', 'mandat' => true), array('type' => 'sec_zero', 'can_be_empty' => true)), 'value_types' => $valueTypesNum), 'nodata' => array('args' => array(array('type' => 'sec_zero', 'mandat' => true)), 'value_types' => $valueTypesAll), 'now' => array('args' => $argsIgnored, 'value_types' => $valueTypesAll), 'prev' => array('args' => $argsIgnored, 'value_types' => $valueTypesAll), 'regexp' => array('args' => array(array('type' => 'str', 'mandat' => true), array('type' => 'sec_num', 'can_be_empty' => true)), 'value_types' => $valueTypesChar), 'str' => array('args' => array(array('type' => 'str', 'mandat' => true), array('type' => 'sec_num', 'can_be_empty' => true)), 'value_types' => $valueTypesChar), 'strlen' => array('args' => array(array('type' => 'sec_num_zero', 'mandat' => true, 'can_be_empty' => true), array('type' => 'sec_zero', 'can_be_empty' => true)), 'value_types' => $valueTypesChar), 'sum' => array('args' => array(array('type' => 'sec_num', 'mandat' => true), array('type' => 'sec_zero', 'can_be_empty' => true)), 'value_types' => $valueTypesNum), 'time' => array('args' => $argsIgnored, 'value_types' => $valueTypesAll));
}
示例2: __construct
public function __construct(array $options = [])
{
parent::__construct($options);
$valueTypesAll = [ITEM_VALUE_TYPE_FLOAT => true, ITEM_VALUE_TYPE_UINT64 => true, ITEM_VALUE_TYPE_STR => true, ITEM_VALUE_TYPE_TEXT => true, ITEM_VALUE_TYPE_LOG => true];
$valueTypesNum = [ITEM_VALUE_TYPE_FLOAT => true, ITEM_VALUE_TYPE_UINT64 => true];
$valueTypesChar = [ITEM_VALUE_TYPE_STR => true, ITEM_VALUE_TYPE_TEXT => true, ITEM_VALUE_TYPE_LOG => true];
$valueTypesLog = [ITEM_VALUE_TYPE_LOG => true];
$valueTypesInt = [ITEM_VALUE_TYPE_UINT64 => true];
$argsIgnored = [['type' => 'str']];
$this->allowed = ['abschange' => ['args' => $argsIgnored, 'value_types' => $valueTypesAll], 'avg' => ['args' => [['type' => 'sec_num', 'mandat' => true], ['type' => 'sec_zero', 'can_be_empty' => true]], 'value_types' => $valueTypesNum], 'band' => ['args' => [['type' => 'sec_num_zero', 'mandat' => true, 'can_be_empty' => true], ['type' => 'num', 'mandat' => true], ['type' => 'sec_zero', 'can_be_empty' => true]], 'value_types' => $valueTypesInt], 'change' => ['args' => $argsIgnored, 'value_types' => $valueTypesAll], 'count' => ['args' => [['type' => 'sec_num', 'mandat' => true], ['type' => 'str'], ['type' => 'operation'], ['type' => 'sec_zero', 'can_be_empty' => true]], 'value_types' => $valueTypesAll], 'date' => ['args' => $argsIgnored, 'value_types' => $valueTypesAll], 'dayofmonth' => ['args' => $argsIgnored, 'value_types' => $valueTypesAll], 'dayofweek' => ['args' => $argsIgnored, 'value_types' => $valueTypesAll], 'delta' => ['args' => [['type' => 'sec_num', 'mandat' => true], ['type' => 'sec_zero', 'can_be_empty' => true]], 'value_types' => $valueTypesNum], 'diff' => ['args' => $argsIgnored, 'value_types' => $valueTypesAll], 'forecast' => ['args' => [['type' => 'sec_num', 'mandat' => true], ['type' => 'sec_zero', 'can_be_empty' => true], ['type' => 'sec_zero', 'mandat' => true], ['type' => 'str', 'can_be_empty' => true], ['type' => 'str', 'can_be_empty' => true]], 'value_types' => $valueTypesNum], 'fuzzytime' => ['args' => [['type' => 'sec_zero', 'mandat' => true]], 'value_types' => $valueTypesNum], 'iregexp' => ['args' => [['type' => 'str', 'mandat' => true], ['type' => 'sec_num', 'can_be_empty' => true]], 'value_types' => $valueTypesChar], 'last' => ['args' => [['type' => 'sec_num_zero', 'mandat' => true, 'can_be_empty' => true], ['type' => 'sec_zero', 'can_be_empty' => true]], 'value_types' => $valueTypesAll], 'logeventid' => ['args' => [['type' => 'str', 'mandat' => true]], 'value_types' => $valueTypesLog], 'logseverity' => ['args' => $argsIgnored, 'value_types' => $valueTypesLog], 'logsource' => ['args' => [['type' => 'str', 'mandat' => true]], 'value_types' => $valueTypesLog], 'max' => ['args' => [['type' => 'sec_num', 'mandat' => true], ['type' => 'sec_zero', 'can_be_empty' => true]], 'value_types' => $valueTypesNum], 'min' => ['args' => [['type' => 'sec_num', 'mandat' => true], ['type' => 'sec_zero', 'can_be_empty' => true]], 'value_types' => $valueTypesNum], 'nodata' => ['args' => [['type' => 'sec_zero', 'mandat' => true]], 'value_types' => $valueTypesAll], 'now' => ['args' => $argsIgnored, 'value_types' => $valueTypesAll], 'percentile' => ['args' => [['type' => 'sec_num', 'mandat' => true], ['type' => 'sec_zero', 'can_be_empty' => true], ['type' => 'percent', 'mandat' => true]], 'value_types' => $valueTypesNum], 'prev' => ['args' => $argsIgnored, 'value_types' => $valueTypesAll], 'regexp' => ['args' => [['type' => 'str', 'mandat' => true], ['type' => 'sec_num', 'can_be_empty' => true]], 'value_types' => $valueTypesChar], 'str' => ['args' => [['type' => 'str', 'mandat' => true], ['type' => 'sec_num', 'can_be_empty' => true]], 'value_types' => $valueTypesChar], 'strlen' => ['args' => [['type' => 'sec_num_zero', 'mandat' => true, 'can_be_empty' => true], ['type' => 'sec_zero', 'can_be_empty' => true]], 'value_types' => $valueTypesChar], 'sum' => ['args' => [['type' => 'sec_num', 'mandat' => true], ['type' => 'sec_zero', 'can_be_empty' => true]], 'value_types' => $valueTypesNum], 'time' => ['args' => $argsIgnored, 'value_types' => $valueTypesAll], 'timeleft' => ['args' => [['type' => 'sec_num', 'mandat' => true], ['type' => 'sec_zero', 'can_be_empty' => true], ['type' => 'num', 'mandat' => true], ['type' => 'str', 'can_be_empty' => true]], 'value_types' => $valueTypesNum]];
}
示例3: __construct
public function __construct(array $options = [])
{
// set validators via the public setter method
if (isset($options['validators'])) {
foreach ($options['validators'] as $field => $validator) {
$this->setValidator($field, $validator);
}
}
unset($options['validator']);
// set post validators via the public setter method
if (isset($options['postValidators'])) {
foreach ($options['postValidators'] as $validator) {
$this->addPostValidator($validator);
}
}
unset($options['validator']);
parent::__construct($options);
}