Fixed ObjectHydrator when namespace alias is given.
This commit is contained in:
parent
f5f583d1cc
commit
23e0bb7345
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user