Added type conversion to meta column in case a type is specified (such as a foreign key or discriminator column).
This commit is contained in:
parent
21437bb276
commit
35c8cd7f23
1 changed files with 14 additions and 3 deletions
|
@ -197,10 +197,11 @@ abstract class AbstractHydrator
|
|||
*/
|
||||
protected function cleanup()
|
||||
{
|
||||
$this->_rsm = null;
|
||||
|
||||
$this->_stmt->closeCursor();
|
||||
$this->_stmt = null;
|
||||
|
||||
$this->_stmt = null;
|
||||
$this->_rsm = null;
|
||||
$this->_cache = array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -277,6 +278,7 @@ abstract class AbstractHydrator
|
|||
case (isset($cacheKeyInfo['isMetaColumn'])):
|
||||
$dqlAlias = $cacheKeyInfo['dqlAlias'];
|
||||
$fieldName = $cacheKeyInfo['fieldName'];
|
||||
$type = $cacheKeyInfo['type'];
|
||||
|
||||
// Avoid double setting or null assignment
|
||||
if (isset($rowData['data'][$dqlAlias][$fieldName]) || $value === null) {
|
||||
|
@ -288,6 +290,10 @@ abstract class AbstractHydrator
|
|||
$nonemptyComponents[$dqlAlias] = true;
|
||||
}
|
||||
|
||||
if ($type) {
|
||||
$value = $type->convertToPHPValue($value, $this->_platform);
|
||||
}
|
||||
|
||||
$rowData['data'][$dqlAlias][$fieldName] = $value;
|
||||
break;
|
||||
|
||||
|
@ -359,6 +365,11 @@ abstract class AbstractHydrator
|
|||
|
||||
case (isset($cacheKeyInfo['isMetaColumn'])):
|
||||
$dqlAlias = $cacheKeyInfo['dqlAlias'];
|
||||
$type = $cacheKeyInfo['type'];
|
||||
|
||||
if ($type) {
|
||||
$value = $type->convertToPHPValue($value, $this->_platform);
|
||||
}
|
||||
|
||||
$rowData[$dqlAlias . '_' . $fieldName] = $value;
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue