A trait that allows a class to build and apply application. rules.
If the implementing class also implements EventAwareTrait, then events will be emitted when rules are checked.
The implementing class is expected to define the RULES_CLASS constant if they need to customize which class is used for rules objects.
buildRules( Cake\Datasource\RulesChecker $rules )
Returns a RulesChecker object after modifying the one that was supplied.
Subclasses should override this method in order to initialize the rules to be applied to entities saved by this instance.
Cake\Datasource\RulesChecker $rules Cake\Datasource\RulesCheckercheckRules( Cake\Datasource\EntityInterface $entity , string $operation Cake\Datasource\RulesChecker::CREATE , ArrayObject|array $options null )
Returns whether or not the passed entity complies with all the rules stored in the rules checker.
Cake\Datasource\EntityInterface $entity $operation optional Cake\Datasource\RulesChecker::CREATE $options optional null booleanrulesChecker( )
Returns the RulesChecker for this instance.
A RulesChecker object is used to test an entity for validity on rules that may involve complex logic or data that needs to be fetched from relevant datasources.
Cake\Datasource\RulesCheckerCake\Datasource\RulesChecker
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.Datasource.RulesAwareTrait.html