$name
$name : string
The rule name
Contains logic for invoking an application rule.
Combined with Cake\Datasource\RuleChecker as an implementation detail to de-duplicate rule decoration and provide cleaner separation of duties.
__construct(callable $rule, string $name, array $options = array())
Constructor
errorField
The field errors should be set onto.message
The error message.Individual rules may have additional options that can be set here. Any options will be passed into the rule as part of the rule $scope.
callable | $rule | The rule to be invoked. |
string | $name | The name of the rule. Used in error messsages. |
array | $options | The options for the rule. See above. |
__invoke(\Cake\Datasource\EntityInterface $entity, array $scope) : boolean
Invoke the rule.
\Cake\Datasource\EntityInterface | $entity | The entity the rule should apply to. |
array | $scope | The rule's scope/options. |
Whether or not the rule passed.
Loading…