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
6402b73b
Commit
6402b73b
authored
Sep 21, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Doctrine_EventListener_Chain, renamed onPreSetProperty to onSetProperty
parent
0a460712
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
185 additions
and
12 deletions
+185
-12
EventListener.php
Doctrine/EventListener.php
+1
-1
AccessorInvoker.php
Doctrine/EventListener/AccessorInvoker.php
+1
-1
Chain.php
Doctrine/EventListener/Chain.php
+182
-9
Record.php
Doctrine/Record.php
+1
-1
No files found.
Doctrine/EventListener.php
View file @
6402b73b
...
...
@@ -52,7 +52,7 @@ abstract class Doctrine_EventListener implements Doctrine_EventListener_Interfac
public
function
onGetProperty
(
Doctrine_Record
$record
,
$property
,
$value
)
{
return
$value
;
}
public
function
on
Pre
SetProperty
(
Doctrine_Record
$record
,
$property
,
$value
)
{
public
function
onSetProperty
(
Doctrine_Record
$record
,
$property
,
$value
)
{
return
$value
;
}
...
...
Doctrine/EventListener/AccessorInvoker.php
View file @
6402b73b
...
...
@@ -64,7 +64,7 @@ class Doctrine_EventListener_AccessorInvoker extends Doctrine_EventListener {
* @param mixed $value
* @return mixed
*/
public
function
on
Pre
SetProperty
(
Doctrine_Record
$record
,
$property
,
$value
)
{
public
function
onSetProperty
(
Doctrine_Record
$record
,
$property
,
$value
)
{
$method
=
'set'
.
ucwords
(
$property
);
if
(
method_exists
(
$record
,
$method
)
&&
!
$this
->
lockSetCall
)
{
...
...
Doctrine/EventListener/Chain.php
View file @
6402b73b
...
...
@@ -38,16 +38,189 @@ class Doctrine_EventListener_Chain extends Doctrine_Access {
public
function
set
(
$key
,
Doctrine_EventListener
$listener
)
{
$this
->
listeners
[
$key
]
=
$listener
;
}
/**
* this method should only be called internally by
* doctrine, since it doesn't do any method existence checking
*
* @param method $method
* @param array $args
*/
public
function
__call
(
$method
,
$args
)
{
public
function
onLoad
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onLoad
(
$record
);
}
}
public
function
onPreLoad
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreLoad
(
$record
);
}
}
public
function
onSleep
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onSleep
(
$record
);
}
}
public
function
onWakeUp
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onWakeUp
(
$record
);
}
}
public
function
onUpdate
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onUpdate
(
$record
);
}
}
public
function
onPreUpdate
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreUpdate
(
$record
);
}
}
public
function
onCreate
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onCreate
(
$record
);
}
}
public
function
onPreCreate
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreCreate
(
$record
);
}
}
public
function
onSave
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onSave
(
$record
);
}
}
public
function
onPreSave
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreSave
(
$record
);
}
}
public
function
onGetProperty
(
Doctrine_Record
$record
,
$property
,
$value
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onGetProperty
(
$record
);
}
}
public
function
onSetProperty
(
Doctrine_Record
$record
,
$property
,
$value
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onSetProperty
(
$record
);
}
}
public
function
onInsert
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onInsert
(
$record
);
}
}
public
function
onPreInsert
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreInsert
(
$record
);
}
}
public
function
onDelete
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onDelete
(
$record
);
}
}
public
function
onPreDelete
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreDelete
(
$record
);
}
}
public
function
onEvict
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onEvict
(
$record
);
}
}
public
function
onPreEvict
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreEvict
(
$record
);
}
}
public
function
onSaveCascade
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onSaveCascade
(
$record
);
}
}
public
function
onPreSaveCascade
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreSaveCascade
(
$record
);
}
}
public
function
onDeleteCascade
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onDeleteCascade
(
$record
);
}
}
public
function
onPreDeleteCascade
(
Doctrine_Record
$record
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreDeleteCascade
(
$record
);
}
}
public
function
onClose
(
Doctrine_Connection
$connection
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onClose
(
$record
);
}
}
public
function
onPreClose
(
Doctrine_Connection
$connection
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreClose
(
$record
);
}
}
public
function
onOpen
(
Doctrine_Connection
$connection
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onOpen
(
$record
);
}
}
public
function
onTransactionCommit
(
Doctrine_Connection
$connection
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onTransactionCommit
(
$record
);
}
}
public
function
onPreTransactionCommit
(
Doctrine_Connection
$connection
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreTransactionCommit
(
$record
);
}
}
public
function
onTransactionRollback
(
Doctrine_Connection
$connection
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onTransactionRollback
(
$record
);
}
}
public
function
onPreTransactionRollback
(
Doctrine_Connection
$connection
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreTransactionRollback
(
$record
);
}
}
public
function
onTransactionBegin
(
Doctrine_Connection
$connection
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onTransactionBegin
(
$record
);
}
}
public
function
onPreTransactionBegin
(
Doctrine_Connection
$connection
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onPreTransactionBegin
(
$record
);
}
}
public
function
onCollectionDelete
(
Doctrine_Collection
$collection
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
onCollectionDelete
(
$record
);
}
}
public
function
onPreCollectionDelete
(
Doctrine_Collection
$collection
)
{
foreach
(
$this
->
listeners
as
$listener
)
{
$listener
->
$method
(
$args
[
0
]
);
$listener
->
onPreCollectionDelete
(
$record
);
}
}
}
...
...
Doctrine/Record.php
View file @
6402b73b
...
...
@@ -731,7 +731,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
if
(
$old
!==
$value
)
{
// invoke the onPreSetProperty listener
$value
=
$this
->
table
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
on
Pre
SetProperty
(
$this
,
$name
,
$value
);
$value
=
$this
->
table
->
getAttribute
(
Doctrine
::
ATTR_LISTENER
)
->
onSetProperty
(
$this
,
$name
,
$value
);
if
(
$value
===
null
)
$value
=
self
::
$null
;
...
...
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