Permalink
Browse files

Merge pull request #41 from CammoKing/patch-1

add a method to return an object in Cursor.php
  • Loading branch information...
2 parents 9ba6d5d + c042606 commit f848dca47e688234dca487f3384b8cb204f9cdba @navruzm committed Jun 15, 2014
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/LMongo/Query/Cursor.php
@@ -85,6 +85,16 @@ public function toJson($options = 0)
}
/**
+ * Get the items as an object.
+ *
+ * @return object
+ */
+ public function toObject()
+ {
+ return json_decode(json_encode($this->toArray()), FALSE);
+ }
+
+ /**
* Convert the cursor to string.
*
* @return string
@@ -112,4 +122,4 @@ public function __call($method, $arguments)
return $return;
}
-}
+}

0 comments on commit f848dca

Please sign in to comment.