示例#1
0
 /**
  * 获取“验证时对比值类型”验证规则
  * @param mixed $value
  * @return array
  */
 public function getOptionCategoryRule($value)
 {
     $enum = DataValidators::getOptionCategoryEnum();
     return array('InArray' => new validator\InArrayValidator($value, array_keys($enum), sprintf(Lang::_('SRV_FILTER_BUILDER_FIELD_VALIDATORS_OPTION_CATEGORY_INARRAY'), implode(', ', $enum))));
 }
示例#2
0
 /**
  * 获取验证时对比值类型
  * @param string $optionCategory
  * @return string
  */
 public function getOptionCategoryLangByOptionCategory($optionCategory)
 {
     $enum = DataValidators::getOptionCategoryEnum();
     return isset($enum[$optionCategory]) ? $enum[$optionCategory] : '';
 }
示例#3
0
 /**
  * 获取“验证时对比值类型”所有选项
  * @return array
  */
 public function getOptionCategoryEnum()
 {
     $enum = DataValidators::getOptionCategoryEnum();
     return $enum;
 }