#1178 - handling correct parameter binding when counting extra-lazy collections with custom-type referenced identifiers
This commit is contained in:
parent
c82794bff7
commit
e39f08f6bd
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user