Skip to content
This repository has been archived by the owner on May 31, 2018. It is now read-only.

Commit

Permalink
Merge pull request #41 from CammoKing/patch-1
Browse files Browse the repository at this point in the history
add a method to return an object in Cursor.php
  • Loading branch information
navruzm committed Jun 15, 2014
2 parents 9ba6d5d + c042606 commit f848dca
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/LMongo/Query/Cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ public function toJson($options = 0)
return json_encode($this->toArray(), $options);
}

/**
* Get the items as an object.
*
* @return object
*/
public function toObject()
{
return json_decode(json_encode($this->toArray()), FALSE);
}

/**
* Convert the cursor to string.
*
Expand Down Expand Up @@ -112,4 +122,4 @@ public function __call($method, $arguments)

return $return;
}
}
}

0 comments on commit f848dca

Please sign in to comment.