From ae82b621254e34a6b277fd90f45c2905912abe57 Mon Sep 17 00:00:00 2001 From: zYne Date: Wed, 15 Aug 2007 21:13:16 +0000 Subject: [PATCH] fixes #434 --- manual/new/docs/en/event-listeners.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/manual/new/docs/en/event-listeners.txt b/manual/new/docs/en/event-listeners.txt index ea85f6cd3..b0de45501 100644 --- a/manual/new/docs/en/event-listeners.txt +++ b/manual/new/docs/en/event-listeners.txt @@ -17,7 +17,7 @@ class Blog extends Doctrine_Record $this->hasColumn('content', 'string'); $this->hasColumn('created', 'date'); } - public function preInsert() + public function preInsert($event) { $this->created = date('Y-m-d', time()); } @@ -226,16 +226,16 @@ class MyRecord extends Doctrine_Record ++ Record hooks ||~ Methods ||~ Listens || -|| preSave() || Doctrine_Record::save() || -|| postSave() || Doctrine_Record::save() || -|| preUpdate() || Doctrine_Record::save() when the record state is DIRTY || -|| postUpdate() || Doctrine_Record::save() when the record state is DIRTY || -|| preInsert() || Doctrine_Record::save() when the record state is TDIRTY || -|| postInsert() || Doctrine_Record::save() when the record state is TDIRTY || -|| preDelete() || Doctrine_Record::delete() || -|| postDelete() || Doctrine_Record::delete() || -|| preValidate() || Doctrine_Validator::validate() || -|| postValidate() || Doctrine_Validator::validate() || +|| preSave($event) || Doctrine_Record::save() || +|| postSave($event) || Doctrine_Record::save() || +|| preUpdate($event) || Doctrine_Record::save() when the record state is DIRTY || +|| postUpdate($event) || Doctrine_Record::save() when the record state is DIRTY || +|| preInsert($event) || Doctrine_Record::save() when the record state is TDIRTY || +|| postInsert($event) || Doctrine_Record::save() when the record state is TDIRTY || +|| preDelete($event) || Doctrine_Record::delete() || +|| postDelete($event) || Doctrine_Record::delete() || +|| preValidate($event) || Doctrine_Validator::validate() || +|| postValidate($event) || Doctrine_Validator::validate() || Example 1. Using insert and update hooks @@ -248,11 +248,11 @@ class Blog extends Doctrine_Record $this->hasColumn('created', 'date'); $this->hasColumn('updated', 'date'); } - public function preInsert() + public function preInsert($event) { $this->created = date('Y-m-d', time()); } - public function preUpdate() + public function preUpdate($event) { $this->updated = date('Y-m-d', time()); }