[DDC-952] Fix merge/rebase mistake.
This commit is contained in:
parent
03630df20d
commit
d9c8a9eecb
@ -804,18 +804,21 @@ class BasicEntityPersister
|
|||||||
* @param PersistentCollection $coll
|
* @param PersistentCollection $coll
|
||||||
*/
|
*/
|
||||||
private function loadCollectionFromStatement($assoc, $stmt, $coll)
|
private function loadCollectionFromStatement($assoc, $stmt, $coll)
|
||||||
{
|
{
|
||||||
|
$hints = array('deferEagerLoads' => true);
|
||||||
if (isset($assoc['indexBy'])) {
|
if (isset($assoc['indexBy'])) {
|
||||||
while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$entity = $this->_createEntity($result);
|
$entity = $this->_createEntity($result, null, $hints);
|
||||||
$coll->hydrateSet($this->_class->reflFields[$assoc['indexBy']]->getValue($entity), $entity);
|
$coll->hydrateSet($this->_class->reflFields[$assoc['indexBy']]->getValue($entity), $entity);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$coll->hydrateAdd($this->_createEntity($result));
|
$coll->hydrateAdd($this->_createEntity($result, null, $hints));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
|
$this->_em->getUnitOfWork()->triggerEagerLoads();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -880,14 +883,7 @@ class BasicEntityPersister
|
|||||||
|
|
||||||
$sql = $this->_getSelectEntitiesSQL($criteria, $assoc, 0, $limit, $offset);
|
$sql = $this->_getSelectEntitiesSQL($criteria, $assoc, 0, $limit, $offset);
|
||||||
list($params, $types) = $this->expandParameters($criteria);
|
list($params, $types) = $this->expandParameters($criteria);
|
||||||
$stmt = $this->_conn->executeQuery($sql, $params, $types);
|
return $this->_conn->executeQuery($sql, $params, $types);
|
||||||
$hints = array('deferEagerLoads' => true);
|
|
||||||
while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
|
||||||
$coll->hydrateAdd($this->_createEntity($result, null, $hints));
|
|
||||||
}
|
|
||||||
$stmt->closeCursor();
|
|
||||||
|
|
||||||
$this->_em->getUnitOfWork()->triggerEagerLoads();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1348,15 +1344,7 @@ class BasicEntityPersister
|
|||||||
$sql = $this->_getSelectEntitiesSQL($criteria, $assoc, 0, $limit, $offset);
|
$sql = $this->_getSelectEntitiesSQL($criteria, $assoc, 0, $limit, $offset);
|
||||||
list($params, $types) = $this->expandParameters($criteria);
|
list($params, $types) = $this->expandParameters($criteria);
|
||||||
|
|
||||||
$stmt = $this->_conn->executeQuery($sql, $params, $types);
|
return $this->_conn->executeQuery($sql, $params, $types);
|
||||||
$hints = array('deferEagerLoads' => true);
|
|
||||||
while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
|
||||||
$coll->hydrateAdd($this->_createEntity($result, null, $hints));
|
|
||||||
}
|
|
||||||
$stmt->closeCursor();
|
|
||||||
|
|
||||||
$this->_em->getUnitOfWork()->triggerEagerLoads();
|
|
||||||
return $stmt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user