theodo/TheodoFrameworkExtraBundle — pull request #2 by benja-M-1 (2013-12-27 15:24:39+00:00)
Title: Add compiler pass that auto register repositories in the container

This PR adds a compiler pass that is able to register a repository as repository for each entity that doctrine is aware of. If no repository is specified for an entity then it uses the ```Doctrine\ORM\EntityRepository```.

## Usage

Given a place entity is defined:

```php

namespace Foo\Bundle\BarBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity(repositoryClass="Foo\Bundle\BarBundle\Repository\PlaceRepository")
*/
class Place
{
/** @ORM\Id() */
private $id;

/** @ORM\Column(type="string", length=255) */
private $name;
}
```

And the ```TheodoFrameworkExtraBundle``` is registered in ```AppKernel.php```
When I call the service ```$container->get('repository.place_repository')```
Then it should return an instance of ```Foo\Bundle\BarBundle\Repository\PlaceRepository``` class

## Todo

- [ ] Add the bundle (or the namespace) in the id of the service to avoid naming collision (e.g foo_bar_bundle.repository.place or foo_bar.repository.place)