Exercise/FOQElasticaBundle — pull request #178 by michaldudek (2012-10-30 23:02:18+00:00)
Title: Provide custom query builder to ElasticaToModelTransformer

Similarly how you can specify a method that will provide a QueryBuilder to Provider, this PR makes it possible to specify a method that will provide a QueryBuilder to ElasticaToModelTransformer in Doctrine.

Config:

persistence:
driver: orm
model: Acme\Bundle\ItemBundle\Entity\Item
provider:
elastica_to_model_transformer:
query_builder_method: getQueryBuilderWithCategories

This will look for ```getQueryBuilderWithCategories()``` method in ```EntityRepository``` for the ```Item``` entity and execute it to get an instance of Doctrine's ```QueryBuilder```.

The default setting is ```createQueryBuilder``` and it requires an alias as the only argument. ```objectClass``` is provided for this (and also any other custom method).

One use case for this feature is to join other Doctrine entities into the results set (e.g. related items or categories).

Related issue (request):
https://github.com/Exercise/FOQElasticaBundle/issues/26