Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #37 from daniphp/master
Browse files Browse the repository at this point in the history
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
Jonathan Moss committed Apr 17, 2012
2 parents cce7a14 + 3ed9925 commit 6365a53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/morph/property/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -72,6 +72,10 @@ public function __setRawValue($value)
$this->value = null;
}
}

if (null != $state) {
$this->state = $state;
}
return $this;
}

Expand Down

0 comments on commit 6365a53

Please sign in to comment.