Permalink
Browse files

Merge pull request #37 from daniphp/master

The state for date property was not properly loaded - Thanks daniphp

Note: In the future please can you issue pull requests from a fresh branch rather than master.  This pull request actually contained both this bug fix and the fix for property set state. Pull requests are not static, i.e. if you make further updates they will also be reflected in the pull request. Hence using a clean branch for each pull request. Since in this case I already merged the other pull request I will go ahead with it anyway.

Unit tests are also helpful :)
  • Loading branch information...
2 parents cce7a14 + 3ed9925 commit 6365a53cb2722ce2d74b0652b5caf2d59b73587d Jonathan Moss committed Apr 17, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/morph/property/Date.php
@@ -61,7 +61,7 @@ public function __getRawValue()
* @param $value
* @return Morph_Property_Generic
*/
- public function __setRawValue($value)
+ public function __setRawValue($value, $state = null)
{
if ($value instanceof \MongoDate) {
$this->value = (int) $value->sec;
@@ -72,6 +72,10 @@ public function __setRawValue($value)
$this->value = null;
}
}
+
+ if (null != $state) {
+ $this->state = $state;
+ }
return $this;
}

0 comments on commit 6365a53

Please sign in to comment.