1
0
mirror of synced 2024-12-05 03:06:05 +03:00

Fixed owing-inverse side search by criteria

This commit is contained in:
Asmir Mustafic 2015-01-30 00:24:09 +01:00 committed by Marco Pivetta
parent 4d531d8855
commit 1630ec1ebd

View File

@ -1650,14 +1650,18 @@ class BasicEntityPersister implements EntityPersister
$association = $this->class->associationMappings[$field];
// Many-To-Many requires join table check for joinColumn
$columns = array();
$class = $this->class;
if ($association['type'] === ClassMetadata::MANY_TO_MANY) {
if ( ! $association['isOwningSide']) {
$association = $assoc;
}
$joinColumns = $assoc['isOwningSide']
? $association['joinTable']['joinColumns']
: $association['joinTable']['inverseJoinColumns'];
$joinTableName = $this->quoteStrategy->getJoinTableName($association, $this->class, $this->platform);
foreach ($association['joinTable']['joinColumns'] as $joinColumn) {
$columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
$joinTableName = $this->quoteStrategy->getJoinTableName($association, $class, $this->platform);
foreach ($joinColumns as $joinColumn) {
$columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
}
} else {