Exercise/FOQElasticaBundle — pull request #38 by richardmiller (2011-11-12 21:20:38+00:00)
Title: Adding manager that returns Doctrine style repositories

Added a manager class that returns Doctrine style repositories so that you can just inject the ```foq_elastica.manager``` service and then ask it for the repository for an entity rather than injecting a finder service for each entity type.

Main use is to allow encapsulating custom queries to avoid keeping them in controller and to allow easy reuse. E.g. :

```
setFieldQuery('name', $searchTerm);
$urlQuery = new \Elastica_Query_Text();
$urlQuery->setFieldQuery('url', $searchTerm);
$boolQuery->addShould($nameQuery);
$boolQuery->addShould($urlQuery);

return $this->find($boolQuery);
}

}
```

```
$repository = $this->get('foq_elastica.manager')->getRespository('ExampleBundle\Entity\ExampleEntity');
$results = $repository->findByNameOrUrl($searchTerm);
```

Fully qualified entity/document name needs to be specified as doesn't yet support Doctrine style ```Bundle:EntityName``` syntax.