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
846e0bfd
Commit
846e0bfd
authored
Sep 06, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Better fix for #2478.
parent
e0012f07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
ObjectHydrator.php
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
+22
-10
No files found.
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php
View file @
846e0bfd
...
...
@@ -138,18 +138,30 @@ class ObjectHydrator extends AbstractHydrator
$class
=
$this
->
_ce
[
get_class
(
$entity
)];
$relation
=
$class
->
associationMappings
[
$name
];
$pColl
=
new
PersistentCollection
(
$this
->
_em
,
$this
->
_ce
[
$relation
->
targetEntityName
],
new
ArrayCollection
);
$value
=
$class
->
reflFields
[
$name
]
->
getValue
(
$entity
);
if
(
$value
===
null
)
{
$value
=
new
ArrayCollection
;
}
if
(
$value
instanceof
ArrayCollection
)
{
$value
=
new
PersistentCollection
(
$this
->
_em
,
$this
->
_ce
[
$relation
->
targetEntityName
],
$value
);
$value
->
setOwner
(
$entity
,
$relation
);
}
else
{
// Is already PersistentCollection.
$value
->
clear
();
$value
->
setDirty
(
false
);
$value
->
setInitialized
(
true
);
}
$pColl
->
setOwner
(
$entity
,
$relation
);
$class
->
reflFields
[
$name
]
->
setValue
(
$entity
,
$pColl
);
$this
->
_uow
->
setOriginalEntityProperty
(
$oid
,
$name
,
$pColl
);
$this
->
_initializedCollections
[
$oid
.
$name
]
=
$pColl
;
$class
->
reflFields
[
$name
]
->
setValue
(
$entity
,
$value
);
$this
->
_uow
->
setOriginalEntityProperty
(
$oid
,
$name
,
$value
);
$this
->
_initializedCollections
[
$oid
.
$name
]
=
$value
;
return
$
pColl
;
return
$
value
;
}
/**
...
...
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