Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
ae82b621
Commit
ae82b621
authored
Aug 15, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #434
parent
b54d56a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
event-listeners.txt
manual/new/docs/en/event-listeners.txt
+13
-13
No files found.
manual/new/docs/en/event-listeners.txt
View file @
ae82b621
...
...
@@ -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
<code type="php">
...
...
@@ -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());
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment