/** * 获取“验证时对比值类型”验证规则 * @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)))); }
/** * 获取验证时对比值类型 * @param string $optionCategory * @return string */ public function getOptionCategoryLangByOptionCategory($optionCategory) { $enum = DataValidators::getOptionCategoryEnum(); return isset($enum[$optionCategory]) ? $enum[$optionCategory] : ''; }
/** * 获取“验证时对比值类型”所有选项 * @return array */ public function getOptionCategoryEnum() { $enum = DataValidators::getOptionCategoryEnum(); return $enum; }