From 4b95d0504cba35948915c9a8811bfc266e18c023 Mon Sep 17 00:00:00 2001 From: dbrewer Date: Sat, 19 Jan 2008 02:35:39 +0000 Subject: [PATCH] Merged r3550 from 0.9 branch to trunk. --- lib/Doctrine/Record.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index 479c60a6c..7f16c300e 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -445,7 +445,8 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count /** * cleanData * leaves the $data array only with values whose key is a field inside this - * record and returns the values that where removed from $data. + * record and returns the values that were removed from $data. Also converts + * any values of 'null' to objects of type Doctrine_Null. * * @param array $data data array to be cleaned * @return array $tmp values cleaned from data @@ -459,6 +460,8 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count foreach ($fieldNames as $fieldName) { if (isset($tmp[$fieldName])) { $data[$fieldName] = $tmp[$fieldName]; + } else if (array_key_exists($fieldName, $tmp)) { + $data[$fieldName] = self::$_null; } else if (!isset($this->_data[$fieldName])) { $data[$fieldName] = self::$_null; }