lithium\util\Validator::has()

public static method

Checks whether a rule under given name exists and can be called using is<Name> syntax.

Parameters

  • string $rule

    Name of the rule.

Returns

boolean

true if the rule exists, false if not.

Source

	public static function has($rule) {
		if (!preg_match('/^(is)?([A-Za-z0-9]+)$/', $rule, $matches)) {
			return false;
		}
		$matches[2][0] = strtolower($matches[2][0]);
		return isset(static::$_rules[$matches[2]]);
	}