Last active
October 25, 2016 14:48
-
-
Save morontt/ecdcc638836e4f91d510901f0557f3a8 to your computer and use it in GitHub Desktop.
Service Container in Repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace SheimarkBundle\Entity\Repository; | |
use Doctrine\ORM\EntityRepository; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
class SalesTaxCodeRepository extends EntityRepository | |
{ | |
/** | |
* @var ContainerInterface | |
*/ | |
protected $container; | |
public function setContainer(ContainerInterface $container = null) | |
{ | |
$this->container = $container; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
sheimark.sales_repository: | |
class: SheimarkBundle\Entity\Repository\SalesTaxCodeRepository | |
factory: ['@doctrine.orm.entity_manager', getRepository] | |
arguments: | |
- "SheimarkBundle:SalesTaxCode" | |
calls: | |
- [ setContainer, ["@service_container"]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment