protected _call ( array $rule, mixed $user, mixed $request, array $options ) : boolean | ||
$rule | array | The rule definition array. |
$user | mixed | The value representing the user making the request. Usually an array. |
$request | mixed | The value representing request data or the object being access. |
$options | array | Any options passed to `check()`. |
Résultat | boolean | Returns `true` if the call to the rule was successful, otherwise `false` if the call failed, or if a callable rule was not found. |
protected function _call($rule, $user, $request, array $options)
{
$callable = null;
switch (true) {
case is_callable($rule['rule']):
$callable = $rule['rule'];
break;
case in_array($rule['rule'], array_keys($this->_rules)):
$callable = $this->_rules[$rule['rule']];
break;
}
return $callable ? call_user_func($callable, $user, $request, $rule + $options) : false;
}