From 7bfc102d65f73615c26bf5b4dccbe72706b3adc1 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Fri, 5 Dec 2014 15:58:25 +0100 Subject: [PATCH] Added the buildValidation event to behaviors --- src/ORM/Behavior.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ORM/Behavior.php b/src/ORM/Behavior.php index b5abbb4b4cf..34639ff8d9a 100644 --- a/src/ORM/Behavior.php +++ b/src/ORM/Behavior.php @@ -53,8 +53,13 @@ * $primary parameter indicates whether or not this is the root query, * or an associated query. * + * - `buildValidator(Event $event, Validator $validator, string $name)` + * Fired when the validator object identified by $name is being built. Yiu can use this + * callback to add validation rules or add validation providers. + * * - `buildRules(Event $event, RulesChecker $rules)` - * Allows listeners to modify the rules checker by adding more rules. + * Fired when the rules checking object for the table is being built. You can use this + * callback to add more rules to the set. * * - `beforeRules(Event $event, Entity $entity, RulesChecker $rules)` * Fired before an entity is validated using the rules checker. By stopping this event, @@ -243,6 +248,7 @@ public function implementedEvents() { 'Model.afterSave' => 'afterSave', 'Model.beforeDelete' => 'beforeDelete', 'Model.afterDelete' => 'afterDelete', + 'Model.buildValidator' => 'buildValidator', 'Model.buildRules' => 'buildRules', 'Model.beforeRules' => 'beforeRules', 'Model.afterRules' => 'afterRules',