1
0
mirror of synced 2025-01-19 15:01:40 +03:00

DDC-546 - Found some more code that needs DDC-117 compliance.

This commit is contained in:
Benjamin Eberlei 2011-01-02 15:14:12 +01:00
parent 247fc43cef
commit 3539b32629
2 changed files with 10 additions and 2 deletions

View File

@ -210,7 +210,11 @@ class ManyToManyPersister extends AbstractCollectionPersister
} }
$whereClause .= "$joinTableColumn = ?"; $whereClause .= "$joinTableColumn = ?";
$params[] = $id[$class->fieldNames[$joinColumns[$joinTableColumn]]]; if ($class->containsForeignIdentifier) {
$params[] = $id[$class->getFieldForColumn($joinColumns[$joinTableColumn])];
} else {
$params[] = $id[$class->fieldNames[$joinColumns[$joinTableColumn]]];
}
} }
} }
$sql = 'SELECT count(*) FROM ' . $joinTable['name'] . ' WHERE ' . $whereClause; $sql = 'SELECT count(*) FROM ' . $joinTable['name'] . ' WHERE ' . $whereClause;

View File

@ -134,7 +134,11 @@ class OneToManyPersister extends AbstractCollectionPersister
$where .= ' AND '; $where .= ' AND ';
} }
$where .= $joinColumn['name'] . " = ?"; $where .= $joinColumn['name'] . " = ?";
$params[] = $id[$class->fieldNames[$joinColumn['referencedColumnName']]]; if ($class->containsForeignIdentifier) {
$params[] = $id[$class->getFieldForColumn($joinColumn['referencedColumnName'])];
} else {
$params[] = $id[$class->fieldNames[$joinColumn['referencedColumnName']]];
}
} }
$sql = "SELECT count(*) FROM " . $class->getQuotedTableName($this->_conn->getDatabasePlatform()) . " WHERE " . $where; $sql = "SELECT count(*) FROM " . $class->getQuotedTableName($this->_conn->getDatabasePlatform()) . " WHERE " . $where;