1
0
mirror of synced 2024-12-13 14:56:01 +03:00

Fixed ObjectHydrator when namespace alias is given.

This commit is contained in:
Szczepan Cieślik 2013-01-24 15:50:05 +01:00
parent f5f583d1cc
commit 23e0bb7345

View File

@ -83,7 +83,7 @@ class ObjectHydrator extends AbstractHydrator
*/
private $existingCollections = array();
/**
/**
* {@inheritdoc}
*/
protected function prepare()
@ -102,6 +102,12 @@ class ObjectHydrator extends AbstractHydrator
$this->identifierMap[$dqlAlias] = array();
$this->idTemplate[$dqlAlias] = '';
// Check for namespace alias.
if (strpos($className, ':') !== false) {
$metadata = $this->_em->getClassMetadata($className);
$className = $metadata->name;
}
if ( ! isset($this->ce[$className])) {
$this->ce[$className] = $this->_em->getClassMetadata($className);
}
@ -525,7 +531,7 @@ class ObjectHydrator extends AbstractHydrator
// check for existing result from the iterations before
if ( ! isset($this->identifierMap[$dqlAlias][$id[$dqlAlias]])) {
$element = $this->getEntity($rowData[$dqlAlias], $dqlAlias);
if ($this->_rsm->isMixed) {
$element = array($entityKey => $element);
}
@ -597,7 +603,7 @@ class ObjectHydrator extends AbstractHydrator
if ($count === 1) {
$result[$resultKey] = $obj;
continue;
}