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
9200e17b
Commit
9200e17b
authored
Oct 15, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0][DDC-51] Fixed.
parent
5842411a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
11 deletions
+10
-11
OneToManyMapping.php
lib/Doctrine/ORM/Mapping/OneToManyMapping.php
+8
-8
OneToOneMapping.php
lib/Doctrine/ORM/Mapping/OneToOneMapping.php
+2
-2
OneToManyBidirectionalAssociationTest.php
.../ORM/Functional/OneToManyBidirectionalAssociationTest.php
+0
-1
No files found.
lib/Doctrine/ORM/Mapping/OneToManyMapping.php
View file @
9200e17b
...
...
@@ -106,13 +106,13 @@ class OneToManyMapping extends AssociationMapping
}
/**
* Loads a one-to-many collection.
*
*
* @param $sourceEntity
* @param $targetCollection
* @param $em
* @param $sourceEntity The entity that owns the collection.
* @param $targetCollection The collection to load/fill.
* @param $em The EntityManager to use.
* @param $joinColumnValues
* @return
unknown_type
* @return
void
*/
public
function
load
(
$sourceEntity
,
$targetCollection
,
$em
,
array
$joinColumnValues
=
array
())
{
...
...
@@ -121,9 +121,9 @@ class OneToManyMapping extends AssociationMapping
$sourceClass
=
$em
->
getClassMetadata
(
$this
->
sourceEntityName
);
$owningAssoc
=
$em
->
getClassMetadata
(
$this
->
targetEntityName
)
->
associationMappings
[
$this
->
mappedByFieldName
];
// TRICKY: since the association is specular source and target are flipped
foreach
(
$owningAssoc
->
getTargetToSourceKeyColumns
()
as
$sourceKeyColumn
=>
$targetKeyColumn
)
{
foreach
(
$owningAssoc
->
targetToSourceKeyColumns
as
$sourceKeyColumn
=>
$targetKeyColumn
)
{
// getting id
if
(
isset
(
$sourceClass
->
reflField
s
[
$sourceKeyColumn
]))
{
if
(
isset
(
$sourceClass
->
fieldName
s
[
$sourceKeyColumn
]))
{
$conditions
[
$targetKeyColumn
]
=
$sourceClass
->
reflFields
[
$sourceClass
->
fieldNames
[
$sourceKeyColumn
]]
->
getValue
(
$sourceEntity
);
}
else
{
$conditions
[
$targetKeyColumn
]
=
$joinColumnValues
[
$sourceKeyColumn
];
...
...
lib/Doctrine/ORM/Mapping/OneToOneMapping.php
View file @
9200e17b
...
...
@@ -201,7 +201,7 @@ class OneToOneMapping extends AssociationMapping
if
(
$this
->
isOwningSide
)
{
foreach
(
$this
->
sourceToTargetKeyColumns
as
$sourceKeyColumn
=>
$targetKeyColumn
)
{
// getting customer_id
if
(
isset
(
$sourceClass
->
reflField
s
[
$sourceKeyColumn
]))
{
if
(
isset
(
$sourceClass
->
fieldName
s
[
$sourceKeyColumn
]))
{
$conditions
[
$targetKeyColumn
]
=
$sourceClass
->
reflFields
[
$sourceClass
->
fieldNames
[
$sourceKeyColumn
]]
->
getValue
(
$sourceEntity
);
}
else
{
$conditions
[
$targetKeyColumn
]
=
$joinColumnValues
[
$sourceKeyColumn
];
...
...
@@ -220,7 +220,7 @@ class OneToOneMapping extends AssociationMapping
// TRICKY: since the association is specular source and target are flipped
foreach
(
$owningAssoc
->
targetToSourceKeyColumns
as
$sourceKeyColumn
=>
$targetKeyColumn
)
{
// getting id
if
(
isset
(
$sourceClass
->
reflField
s
[
$sourceKeyColumn
]))
{
if
(
isset
(
$sourceClass
->
fieldName
s
[
$sourceKeyColumn
]))
{
$conditions
[
$targetKeyColumn
]
=
$sourceClass
->
reflFields
[
$sourceClass
->
fieldNames
[
$sourceKeyColumn
]]
->
getValue
(
$sourceEntity
);
}
else
{
$conditions
[
$targetKeyColumn
]
=
$joinColumnValues
[
$sourceKeyColumn
];
...
...
tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php
View file @
9200e17b
...
...
@@ -87,7 +87,6 @@ class OneToManyBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona
public
function
testLazyLoadsObjectsOnTheOwningSide
()
{
$this
->
_createFixture
();
$this
->
_em
->
getConfiguration
()
->
setAllowPartialObjects
(
false
);
$metadata
=
$this
->
_em
->
getClassMetadata
(
'Doctrine\Tests\Models\ECommerce\ECommerceProduct'
);
$metadata
->
getAssociationMapping
(
'features'
)
->
fetchMode
=
AssociationMapping
::
FETCH_LAZY
;
...
...
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