1
0
mirror of synced 2025-01-19 06:51: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,9 +210,13 @@ class ManyToManyPersister extends AbstractCollectionPersister
} }
$whereClause .= "$joinTableColumn = ?"; $whereClause .= "$joinTableColumn = ?";
if ($class->containsForeignIdentifier) {
$params[] = $id[$class->getFieldForColumn($joinColumns[$joinTableColumn])];
} else {
$params[] = $id[$class->fieldNames[$joinColumns[$joinTableColumn]]]; $params[] = $id[$class->fieldNames[$joinColumns[$joinTableColumn]]];
} }
} }
}
$sql = 'SELECT count(*) FROM ' . $joinTable['name'] . ' WHERE ' . $whereClause; $sql = 'SELECT count(*) FROM ' . $joinTable['name'] . ' WHERE ' . $whereClause;
return $this->_conn->fetchColumn($sql, $params); return $this->_conn->fetchColumn($sql, $params);

View File

@ -134,8 +134,12 @@ class OneToManyPersister extends AbstractCollectionPersister
$where .= ' AND '; $where .= ' AND ';
} }
$where .= $joinColumn['name'] . " = ?"; $where .= $joinColumn['name'] . " = ?";
if ($class->containsForeignIdentifier) {
$params[] = $id[$class->getFieldForColumn($joinColumn['referencedColumnName'])];
} else {
$params[] = $id[$class->fieldNames[$joinColumn['referencedColumnName']]]; $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;
return $this->_conn->fetchColumn($sql, $params); return $this->_conn->fetchColumn($sql, $params);