1
0
mirror of synced 2024-12-14 07:06:04 +03:00

Merge branch 'DDC-1193'

This commit is contained in:
Benjamin Eberlei 2011-06-05 10:03:04 +02:00
commit 2c9a12771b
2 changed files with 3 additions and 7 deletions

View File

@ -563,7 +563,7 @@ class BasicEntityPersister
* @todo Check identity map? loadById method? Try to guess whether $criteria is the id?
*/
public function load(array $criteria, $entity = null, $assoc = null, array $hints = array(), $lockMode = 0)
{
{
$sql = $this->_getSelectEntitiesSQL($criteria, $assoc, $lockMode);
list($params, $types) = $this->expandParameters($criteria);
$stmt = $this->_conn->executeQuery($sql, $params, $types);
@ -577,7 +577,7 @@ class BasicEntityPersister
} else {
$hydrator = $this->_em->newHydrator(Query::HYDRATE_SIMPLEOBJECT);
}
$entities = $hydrator->hydrateAll($stmt, $this->_rsm, $hints);
$entities = $hydrator->hydrateAll($stmt, $this->_rsm, $hints);
return $entities ? $entities[0] : null;
}

View File

@ -1678,10 +1678,6 @@ class UnitOfWork implements PropertyChangedListener
continue;
}
if ($entity instanceof Proxy && !$entity->__isInitialized__) {
$entity->__load();
}
$relatedEntities = $class->reflFields[$assoc['fieldName']]->getValue($entity);
if (($relatedEntities instanceof Collection || is_array($relatedEntities))) {
if ($relatedEntities instanceof PersistentCollection) {
@ -1711,7 +1707,7 @@ class UnitOfWork implements PropertyChangedListener
continue;
}
if ($entity instanceof Proxy) {
if ($entity instanceof Proxy && !$entity->__isInitialized__) {
$entity->__load();
}