rock\sanitize\Sanitize::existsRule PHP Метод

existsRule() публичный Метод

Exists rule.
public existsRule ( string $name ) : boolean
$name string name of rule.
Результат boolean
    public function existsRule($name)
    {
        return isset($this->rules[$name]);
    }

Usage Example

Пример #1
0
 protected function sanitizeInternal(Sanitize $sanitize, $ruleName, $attributeName, $args)
 {
     if ($sanitize instanceof ModelSanitize) {
         $sanitize->model = $this->model;
         $sanitize->attribute = $attributeName;
     }
     if ($sanitize->existsRule($ruleName)) {
         if ($sanitize instanceof ModelSanitize) {
             $sanitize->model = $this->model;
             $sanitize->attribute = $attributeName;
         }
         $this->model->{$attributeName} = call_user_func_array([$sanitize, $ruleName], $args)->sanitize($this->model->{$attributeName});
     }
 }