open-orchestra/open-orchestra-model-bundle

A MongoDB implemantation of the Open Orchestra Model Interface


README

The Open Orchestra model bundle

Service Badge
Travis Build Status
Sensio insight SensioLabsInsight
Code Climate (Quality) Code Climate
Code Climate (Code coverage) Test Coverage
Latest Stable Version Latest Stable Version
Total Downloads Total Downloads

Usage

Once you have installed the bundle, you should activate the aggregator query bundle also in the AppKernel::registerBundles() :

new OpenOrchestra\ModelBundle\OpenOrchestraModelBundle(),
new Solution\MongoAggregationBundle\SolutionMongoAggregationBundle(),

This will allow you to create aggregation query in your repositories by using the method :

AbstractRepository::createAggregationQuery()

With the aggregation, mongo does not return the original document, but by using the $$ROOT parameter, you can add all the fields of the document to the response.

To hydrate all the documents using the database result, use the method :

AbstractRepository::hydrateAggregateQuery()