public function containsNonAlphaNumeric($field, $limit = 1, $message = null, $when = null)
    {
        $extra = array_filter(['on' => $when, 'message' => $message]);

        return $this->add($field, 'containsNonAlphaNumeric', $extra + [
            'rule' => ['containsNonAlphaNumeric', $limit]
        ]);
    }
public function containsNonAlphaNumeric($field, $limit = 1, $message = null, $when = null)
    {
        $extra = array_filter(['on' => $when, 'message' => $message]);

        return $this->add($field, 'containsNonAlphaNumeric', $extra + [
            'rule' => ['containsNonAlphaNumeric', $limit]
        ]);
    }
public function containsNonAlphaNumeric ( $ field , $ limit = 1 , $ message = null , $ when = null ) { $ extra = array_filter ( [ 'on' => $ when , 'message' => $ message ] ) ; return $ this -> add ( $ field , 'containsNonAlphaNumeric' , $ extra + [ 'rule' => [ 'containsNonAlphaNumeric' , $ limit ] ] ) ; }
Add a rule to check if a field contains non alpha numeric characters.

@param string $field The field you want to apply the rule to.
@param int $limit The minimum number of non-alphanumeric fields required.
@param string|null $message The error message when the rule fails.
@param string|callable|null $when Either 'create' or 'update' or a callable that returns
true when the validation rule should be applied.
@see \Cake\Validation\Validation::containsNonAlphaNumeric()
@return $this
Add a rule to check if a field contains non alpha numeric characters .