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
7ef19ad0
Commit
7ef19ad0
authored
Jun 26, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
aa982502
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
2 deletions
+46
-2
event-listeners.txt
manual/new/docs/en/event-listeners.txt
+46
-2
No files found.
manual/new/docs/en/event-listeners.txt
View file @
7ef19ad0
...
...
@@ -184,10 +184,54 @@ $conn->addListener(new Debugger());
$conn->addListener(new Logger());
</code>
++ Altering execution
Doctrine_Event provides many methods for altering the execution of the listened method as well as for altering the behaviour of the listener chain.
++ The Event object
+++ Event codes
Doctrine_Event uses constants as event codes. Above is the list of all availible event constants:
* Doctrine_Event::CONN_QUERY
* Doctrine_Event::CONN_EXEC
* Doctrine_Event::CONN_PREPARE
* Doctrine_Event::CONN_CONNECT
* Doctrine_Event::STMT_EXECUTE
* Doctrine_Event::STMT_FETCH
* Doctrine_Event::STMT_FETCHALL
<code type='php'>
class MyListener extends Doctrine_EventListener
{
public function preExec(Doctrine_Event $event)
{
$event->getCode(); // Doctrine_Event::CONN_EXEC
}
}
</code>
* Doctrine_Event::TX_BEGIN
* Doctrine_Event::TX_COMMIT
* Doctrine_Event::TX_ROLLBACK
* Doctrine_Event::SAVEPOINT_CREATE
* Doctrine_Event::SAVEPOINT_ROLLBACK
* Doctrine_Event::SAVEPOINT_COMMIT
* Doctrine_Event::RECORD_DELETE
* Doctrine_Event::RECORD_SAVE
* Doctrine_Event::RECORD_UPDATE
* Doctrine_Event::RECORD_INSERT
* Doctrine_Event::RECORD_SERIALIZE
* Doctrine_Event::RECORD_UNSERIALIZE
<code type='php'>
class MyRecord extends Doctrine_Record
{
public function preUpdate(Doctrine_Event $event)
{
$event->getCode(); // Doctrine_Event::RECORD_UPDATE
}
}
</code>
+++ skipOperation()
Doctrine_Event provides many methods for altering the execution of the listened method as well as for altering the behaviour of the listener chain.
For some reason you may want to skip the execution of the listened method. It can be done as follows (note that preExec could be any listener method):
...
...
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