Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add table alias to column names for m2m persister (2.4) #765

Closed
wants to merge 1 commit into from

3 participants

@patrickli

2.4 branch version of #764

@doctrinebot
Collaborator

Hello,

thank you for creating this pull request. However did not open it on the "master"
branch. Our Git workflow requires all pull requests to go through "master" branch
and the release masters then merge them back into stable branches, if they are
bug fixes.

Please open the pull request again for the "master" branch and close
this one.

Nevertheless I have opened a Jira ticket for this Pull Request to track this
issue:

http://www.doctrine-project.org/jira/browse/DDC-2626

We use Jira to track the state of pull requests and the versions they got
included in.

@guilhermeblanco

Closing as we cherry pick changes once they're done in master.
Also #767 properly fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 20, 2013
  1. @patrickli
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
View
4 lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
@@ -235,7 +235,7 @@ public function count(PersistentCollection $coll)
foreach ($joinColumns as $joinColumn) {
$columnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
$referencedName = $joinColumn['referencedColumnName'];
- $conditions[] = $columnName . ' = ?';
+ $conditions[] = 't.' . $columnName . ' = ?';
$params[] = ($class->containsForeignIdentifier)
? $id[$class->getFieldForColumn($referencedName)]
: $id[$class->fieldNames[$referencedName]];
@@ -361,7 +361,7 @@ private function getJoinTableRestrictions(PersistentCollection $coll, $element,
$params = array();
foreach ($mapping['joinTableColumns'] as $joinTableColumn) {
- $whereClauses[] = $joinTableColumn . ' = ?';
+ $whereClauses[] = ($addFilters ? 't.' : '') . $joinTableColumn . ' = ?';
if (isset($mapping['relationToTargetKeyColumns'][$joinTableColumn])) {
$params[] = ($targetClass->containsForeignIdentifier)
Something went wrong with that request. Please try again.