title: Symfony 3 Inject service into entity repository
body: <p>I tried inject memcached service into entity repository, but my variant not work.</p>
  
  <pre><code>services:
    work.repository.company:
      class: WorkBundle\Repository\CompanyRepository
      factory: ['@doctrine.orm.entity_manager', getRepository]
      arguments:
          - 'WorkBundle:Company'
      calls:
          - [setCacheService, ['@memcache.default']]
  </code></pre>
  
  <p>CompanyRepository have setter setCacheService, but it's not called.</p>
  
  <pre><code>class CompanyExtension extends \Twig_Extension
  {
      /**
       * @var EntityManager
       */
      private $em;
  
      public function setEntityManager(EntityManager $entityManager)
      {
          $this-&gt;em = $entityManager;
      }
  
      public function getFunctions()
      {
          return array(
              new \Twig_SimpleFunction('getCompaniesCount', array($this, 'getCompaniesCount'))
          );
      }
  
      /**
       * @return integer
       */
      public function getCompaniesCount()
      {
          return $this-&gt;em-&gt;getRepository('WorkBundle:Company')-&gt;getActiveCompaniesCount();
      }
  
      public function getName()
      {
          return 'work_company_extension';
      }
  }
  </code></pre>
  
  <p>Why this code not works?</p>