1
0
Fork 0
mirror of synced 2025-04-01 12:26:11 +03:00

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:
Guilherme Blanco 2014-04-25 05:22:33 +00:00
parent 21437bb276
commit 35c8cd7f23

View file

@ -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;