Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 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]];
 }
Ejemplo n.º 3
0
 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);
 }