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
ac4b4889
Commit
ac4b4889
authored
Oct 26, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0][DDC-57] Fixed.
parent
4918d3e1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
7 deletions
+8
-7
ManyToManyMapping.php
lib/Doctrine/ORM/Mapping/ManyToManyMapping.php
+2
-2
StandardEntityPersister.php
lib/Doctrine/ORM/Persisters/StandardEntityPersister.php
+3
-1
ECommerceCategory.php
tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php
+1
-2
ECommerceProduct.php
tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php
+2
-2
No files found.
lib/Doctrine/ORM/Mapping/ManyToManyMapping.php
View file @
ac4b4889
...
...
@@ -163,7 +163,7 @@ class ManyToManyMapping extends AssociationMapping
if
(
$this
->
isOwningSide
)
{
foreach
(
$this
->
sourceToRelationKeyColumns
as
$sourceKeyColumn
=>
$relationKeyColumn
)
{
// getting id
if
(
isset
(
$sourceClass
->
reflField
s
[
$sourceKeyColumn
]))
{
if
(
isset
(
$sourceClass
->
fieldName
s
[
$sourceKeyColumn
]))
{
$joinTableConditions
[
$relationKeyColumn
]
=
$sourceClass
->
reflFields
[
$sourceClass
->
fieldNames
[
$sourceKeyColumn
]]
->
getValue
(
$sourceEntity
);
}
else
{
$joinTableConditions
[
$relationKeyColumn
]
=
$joinColumnValues
[
$sourceKeyColumn
];
...
...
@@ -174,7 +174,7 @@ class ManyToManyMapping extends AssociationMapping
// TRICKY: since the association is inverted source and target are flipped
foreach
(
$owningAssoc
->
targetToRelationKeyColumns
as
$sourceKeyColumn
=>
$relationKeyColumn
)
{
// getting id
if
(
isset
(
$sourceClass
->
reflField
s
[
$sourceKeyColumn
]))
{
if
(
isset
(
$sourceClass
->
fieldName
s
[
$sourceKeyColumn
]))
{
$joinTableConditions
[
$relationKeyColumn
]
=
$sourceClass
->
reflFields
[
$sourceClass
->
fieldNames
[
$sourceKeyColumn
]]
->
getValue
(
$sourceEntity
);
}
else
{
$joinTableConditions
[
$relationKeyColumn
]
=
$joinColumnValues
[
$sourceKeyColumn
];
...
...
lib/Doctrine/ORM/Persisters/StandardEntityPersister.php
View file @
ac4b4889
...
...
@@ -576,9 +576,11 @@ class StandardEntityPersister
protected
function
_getSelectManyToManyEntityCollectionSql
(
$manyToMany
,
array
&
$criteria
)
{
$columnList
=
''
;
$tableName
=
$this
->
_class
->
getQuotedTableName
(
$this
->
_platform
);
foreach
(
$this
->
_class
->
fieldNames
as
$field
)
{
if
(
$columnList
!=
''
)
$columnList
.=
', '
;
$columnList
.=
$this
->
_class
->
getQuotedColumnName
(
$field
,
$this
->
_platform
);
$columnList
.=
$t
ableName
.
'.'
.
$t
his
->
_class
->
getQuotedColumnName
(
$field
,
$this
->
_platform
);
}
foreach
(
$this
->
_class
->
associationMappings
as
$assoc
)
{
...
...
tests/Doctrine/Tests/Models/ECommerce/ECommerceCategory.php
View file @
ac4b4889
...
...
@@ -15,8 +15,7 @@ use Doctrine\Common\Collections\ArrayCollection;
class
ECommerceCategory
{
/**
* @Column(type="integer")
* @Id
* @Id @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
*/
private
$id
;
...
...
tests/Doctrine/Tests/Models/ECommerce/ECommerceProduct.php
View file @
ac4b4889
...
...
@@ -40,8 +40,8 @@ class ECommerceProduct
/**
* @ManyToMany(targetEntity="ECommerceCategory", cascade={"persist"})
* @JoinTable(name="ecommerce_products_categories",
joinColumns={@JoinColumn(name="product_id", referencedColumnName="id")},
inverseJoinColumns={@JoinColumn(name="category_id", referencedColumnName="id")})
*
joinColumns={@JoinColumn(name="product_id", referencedColumnName="id")},
*
inverseJoinColumns={@JoinColumn(name="category_id", referencedColumnName="id")})
*/
private
$categories
;
...
...
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