colinmollenhour/mongodb-php-odm — pull request #29 by panrafal (2013-01-22 23:28:46+00:00)
Title: Lots of changes for non-Kohana users, additional functionality, operations emulation...

I can keep it on my fork, but I guess these changes could be put to some more widespread use :) If you like some parts more then the others - let me know...

In a glimpse:
* Most of mongo field functions like *inc*, *push*, *pull* etc. will be emulated, so you don't have to reload the document to see the changed values. Actual document processing is of course still done on the server.
* Mongo_Subdocument allows to create simple models for subdocuments
* Static configuration and model declaration, handy if you don't use it in Kohana
* Ability to override connection instance for testing purposes
* Helper functions for some commands like *geoNear*, *mapReduce*, *distinct*, capped collections...
* Mongo_Document implements ArrayAccess, allowing to get/set values using dot notation. Additional get() and getRaw() functions.
* $_references allow to use getter and setter functions for properties
* trying to load a non-existent document will keep it's ID. You can reuse this object to create a new one
* change_id() for easy changing of document id's
* tests ported to phpUnit, tests of new functionality

Apart from keeping the ID (and only ID) after failed load, everything else is backwards compatible with the original library. This sole change could also be made BC by adding an option...