/MongoDb-Integrity-Behavior

A CakePHP Behavior for the mongoDb datasource, to get rid of the MongoDb object in a find resulset

Primary LanguagePHP

Integrity Behavior

Integrity Behavior is a CakePHP Behavior to use with Yasushi Ichikawa MongoDb datasource plugin for CakePHP.

It formats the results of a find() action, to convert all the MongoDb object back to a simple string, because mongodb return by default a MongoId object for the _id ($primaryKey), and a mongoDate object for all the dates.

To use, just drop the Behavior in the behavior folder of your mongodb plugin installation (usually, Plugin/Mongodb/Model/Behavior, and start using by adding the behavior in your model :

public $actsAs = array('Mongodb.Integrity);

Reference

See https://github.com/ichikaway/cakephp-mongodb for the Mongodb Datasource