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
52346aa6
Commit
52346aa6
authored
Oct 07, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved hydration listeners to record listener
parent
dc4d96e9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
24 deletions
+33
-24
Chain.php
lib/Doctrine/EventListener/Chain.php
+0
-13
Interface.php
lib/Doctrine/EventListener/Interface.php
+0
-3
Hydrate.php
lib/Doctrine/Hydrate.php
+4
-4
Record.php
lib/Doctrine/Record.php
+2
-1
Listener.php
lib/Doctrine/Record/Listener.php
+7
-1
Chain.php
lib/Doctrine/Record/Listener/Chain.php
+15
-1
Interface.php
lib/Doctrine/Record/Listener/Interface.php
+5
-1
No files found.
lib/Doctrine/EventListener/Chain.php
View file @
52346aa6
...
@@ -345,19 +345,6 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
...
@@ -345,19 +345,6 @@ class Doctrine_EventListener_Chain extends Doctrine_Access implements Doctrine_E
}
}
}
}
public
function
preHydrate
(
Doctrine_Event
$event
)
{
foreach
(
$this
->
_listeners
as
$listener
)
{
$listener
->
preHydrate
(
$event
);
}
}
public
function
postHydrate
(
Doctrine_Event
$event
)
{
foreach
(
$this
->
_listeners
as
$listener
)
{
$listener
->
postHydrate
(
$event
);
}
}
public
function
preFetch
(
Doctrine_Event
$event
)
public
function
preFetch
(
Doctrine_Event
$event
)
{
{
foreach
(
$this
->
_listeners
as
$listener
)
{
foreach
(
$this
->
_listeners
as
$listener
)
{
...
...
lib/Doctrine/EventListener/Interface.php
View file @
52346aa6
...
@@ -58,9 +58,6 @@ interface Doctrine_EventListener_Interface
...
@@ -58,9 +58,6 @@ interface Doctrine_EventListener_Interface
public
function
preError
(
Doctrine_Event
$event
);
public
function
preError
(
Doctrine_Event
$event
);
public
function
postError
(
Doctrine_Event
$event
);
public
function
postError
(
Doctrine_Event
$event
);
public
function
preHydrate
(
Doctrine_Event
$event
);
public
function
postHydrate
(
Doctrine_Event
$event
);
public
function
preFetch
(
Doctrine_Event
$event
);
public
function
preFetch
(
Doctrine_Event
$event
);
public
function
postFetch
(
Doctrine_Event
$event
);
public
function
postFetch
(
Doctrine_Event
$event
);
...
...
lib/Doctrine/Hydrate.php
View file @
52346aa6
...
@@ -1033,7 +1033,7 @@ class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializab
...
@@ -1033,7 +1033,7 @@ class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializab
$table
=
$this
->
_aliasMap
[
$rootAlias
][
'table'
];
$table
=
$this
->
_aliasMap
[
$rootAlias
][
'table'
];
$componentName
=
$table
->
getComponentName
();
$componentName
=
$table
->
getComponentName
();
$event
->
set
(
'data'
,
$currData
[
$rootAlias
]);
$event
->
set
(
'data'
,
$currData
[
$rootAlias
]);
$table
->
getListener
()
->
preHydrate
(
$event
);
$table
->
get
Record
Listener
()
->
preHydrate
(
$event
);
$element
=
$driver
->
getElement
(
$currData
[
$rootAlias
],
$componentName
);
$element
=
$driver
->
getElement
(
$currData
[
$rootAlias
],
$componentName
);
$oneToOne
=
false
;
$oneToOne
=
false
;
...
@@ -1041,7 +1041,7 @@ class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializab
...
@@ -1041,7 +1041,7 @@ class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializab
$index
=
$driver
->
search
(
$element
,
$array
);
$index
=
$driver
->
search
(
$element
,
$array
);
if
(
$index
===
false
)
{
if
(
$index
===
false
)
{
$event
->
set
(
'data'
,
$element
);
$event
->
set
(
'data'
,
$element
);
$table
->
getListener
()
->
postHydrate
(
$event
);
$table
->
get
Record
Listener
()
->
postHydrate
(
$event
);
if
(
isset
(
$this
->
_aliasMap
[
$rootAlias
][
'map'
]))
{
if
(
isset
(
$this
->
_aliasMap
[
$rootAlias
][
'map'
]))
{
$key
=
$this
->
_aliasMap
[
$rootAlias
][
'map'
];
$key
=
$this
->
_aliasMap
[
$rootAlias
][
'map'
];
...
@@ -1068,7 +1068,7 @@ class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializab
...
@@ -1068,7 +1068,7 @@ class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializab
$table
=
$this
->
_aliasMap
[
$alias
][
'table'
];
$table
=
$this
->
_aliasMap
[
$alias
][
'table'
];
$componentName
=
$table
->
getComponentName
();
$componentName
=
$table
->
getComponentName
();
$event
->
set
(
'data'
,
$data
);
$event
->
set
(
'data'
,
$data
);
$table
->
getListener
()
->
preHydrate
(
$event
);
$table
->
get
Record
Listener
()
->
preHydrate
(
$event
);
$element
=
$driver
->
getElement
(
$data
,
$componentName
);
$element
=
$driver
->
getElement
(
$data
,
$componentName
);
...
@@ -1092,7 +1092,7 @@ class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializab
...
@@ -1092,7 +1092,7 @@ class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializab
if
(
$index
===
false
)
{
if
(
$index
===
false
)
{
$event
->
set
(
'data'
,
$element
);
$event
->
set
(
'data'
,
$element
);
$table
->
getListener
()
->
postHydrate
(
$event
);
$table
->
get
Record
Listener
()
->
postHydrate
(
$event
);
if
(
isset
(
$map
[
'map'
]))
{
if
(
isset
(
$map
[
'map'
]))
{
$key
=
$map
[
'map'
];
$key
=
$map
[
'map'
];
...
...
lib/Doctrine/Record.php
View file @
52346aa6
...
@@ -787,6 +787,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
...
@@ -787,6 +787,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
return
$this
->
_references
[
$name
];
return
$this
->
_references
[
$name
];
}
catch
(
Doctrine_Table_Exception
$e
)
{
}
catch
(
Doctrine_Table_Exception
$e
)
{
foreach
(
$this
->
_table
->
getFilters
()
as
$filter
)
{
foreach
(
$this
->
_table
->
getFilters
()
as
$filter
)
{
if
((
$value
=
$filter
->
filterGet
(
$this
,
$name
,
$value
))
!==
null
)
{
if
((
$value
=
$filter
->
filterGet
(
$this
,
$name
,
$value
))
!==
null
)
{
return
$value
;
return
$value
;
...
@@ -1631,4 +1632,4 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
...
@@ -1631,4 +1632,4 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
{
{
return
(
string
)
$this
->
_oid
;
return
(
string
)
$this
->
_oid
;
}
}
}
}
\ No newline at end of file
lib/Doctrine/Record/Listener.php
View file @
52346aa6
...
@@ -67,4 +67,10 @@ class Doctrine_Record_Listener implements Doctrine_Record_Listener_Interface
...
@@ -67,4 +67,10 @@ class Doctrine_Record_Listener implements Doctrine_Record_Listener_Interface
public
function
postInsert
(
Doctrine_Event
$event
)
public
function
postInsert
(
Doctrine_Event
$event
)
{
}
{
}
}
\ No newline at end of file
public
function
preHydrate
(
Doctrine_Event
$event
)
{
}
public
function
postHydrate
(
Doctrine_Event
$event
)
{
}
}
lib/Doctrine/Record/Listener/Chain.php
View file @
52346aa6
...
@@ -169,4 +169,18 @@ class Doctrine_Record_Listener_Chain extends Doctrine_Access implements Doctrine
...
@@ -169,4 +169,18 @@ class Doctrine_Record_Listener_Chain extends Doctrine_Access implements Doctrine
$listener
->
postInsert
(
$event
);
$listener
->
postInsert
(
$event
);
}
}
}
}
}
\ No newline at end of file
public
function
preHydrate
(
Doctrine_Event
$event
)
{
foreach
(
$this
->
_listeners
as
$listener
)
{
$listener
->
preHydrate
(
$event
);
}
}
public
function
postHydrate
(
Doctrine_Event
$event
)
{
foreach
(
$this
->
_listeners
as
$listener
)
{
$listener
->
postHydrate
(
$event
);
}
}
}
lib/Doctrine/Record/Listener/Interface.php
View file @
52346aa6
...
@@ -55,4 +55,8 @@ interface Doctrine_Record_Listener_Interface
...
@@ -55,4 +55,8 @@ interface Doctrine_Record_Listener_Interface
public
function
preInsert
(
Doctrine_Event
$event
);
public
function
preInsert
(
Doctrine_Event
$event
);
public
function
postInsert
(
Doctrine_Event
$event
);
public
function
postInsert
(
Doctrine_Event
$event
);
}
\ No newline at end of file
public
function
preHydrate
(
Doctrine_Event
$event
);
public
function
postHydrate
(
Doctrine_Event
$event
);
}
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