Maslosoft Mangan Logo Maslosoft Mangan Documentation
MongoDB Object Persister

Edit

Define Model

In many cases, model can be defined as a plain PHP class, with all public properties being stored in MongoDB. These might be sanitized to ensure their type during object life cycle.

Only requirement is to implement AnnotatedInterface interface, which is empty, but it instructs annotations engine that it should process this class.

To fine tune, or to create compositions of objects, annotations can be used.

All model properties can be defined with annotations implemented by addendum project.

Using annotations, allows storing arbitrary PHP object without the need of extending from any base class or implementing any methods.

More about creating models: