Skip to content

Commit

Permalink
Merge pull request #7 from vmanchev/master
Browse files Browse the repository at this point in the history
Fixed bug in Model::toArray() with dates objects
  • Loading branch information
DenchikBY committed May 4, 2016
2 parents 36afa80 + 38a0ab7 commit a32bf4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/MongoDB/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ public function toArray($params = [])
if (gettype($item) == 'object') {
if ($item instanceof ObjectID) {
return (string)$item;
} elseif($item instanceof UTCDateTime){
return $item->toDateTime()->format(DATE_ISO8601);
} else {
return (array)$item;
}
Expand Down

0 comments on commit a32bf4d

Please sign in to comment.