1
0
mirror of synced 2025-01-31 12:32:59 +03:00

#1178 - handling correct parameter binding when counting extra-lazy collections with custom-type referenced identifiers

This commit is contained in:
Marco Pivetta 2015-01-17 04:12:59 +01:00
parent c82794bff7
commit e39f08f6bd

View File

@ -108,6 +108,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
{
$conditions = array();
$params = array();
$types = array();
$mapping = $collection->getMapping();
$id = $this->uow->getEntityIdentifier($collection->getOwner());
$sourceClass = $this->em->getClassMetadata($mapping['sourceEntity']);
@ -126,6 +127,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
$referencedName = $joinColumn['referencedColumnName'];
$conditions[] = 't.' . $columnName . ' = ?';
$params[] = $id[$sourceClass->getFieldForColumn($referencedName)];
$types[] = PersisterHelper::getTypeOfColumn($referencedName, $sourceClass, $this->em);
}
list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($mapping);
@ -156,7 +158,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
. $joinTargetEntitySQL
. ' WHERE ' . implode(' AND ', $conditions);
return $this->conn->fetchColumn($sql, $params);
return $this->conn->fetchColumn($sql, $params, 0, $types);
}
/**