Skip to content

Instantly share code, notes, and snippets.

View nenad-mitic-bg's full-sized avatar

Nenad Mitic nenad-mitic-bg

View GitHub Profile
@nenad-mitic-bg
nenad-mitic-bg / ExampleRepository.php
Created May 20, 2016 09:15 — forked from gnugat/ExampleRepository.php
Declaring a Doctrine Repository as a service and injecting it a dependency.
<?php
namespace Acme\DemoBundle\Repository;
use Acme\DemoBundle\Dependency;
use Doctrine\ORM\EntityRepository;
/**
* Get this repository directly from the container: it will set the $dependency attribute.
* If you get it using Doctrine's "getRepository()", don't forget to call setDependency().