src/EventListener/Doctrine/DoctrineTranslatableExtensionListener.php line 21

Open in your IDE?
  1. <?php
  2.  
  3. namespace App\EventListener\Doctrine;
  4. use Symfony\Component\HttpKernel\Event\RequestEvent;
  5. use Symfony\Component\DependencyInjection\ContainerAwareInterface;
  6. use Symfony\Component\DependencyInjection\ContainerInterface;
  7. class DoctrineTranslatableExtensionListener implements ContainerAwareInterface
  8. {
  9.     /**
  10.      * @var ContainerInterface
  11.      */
  12.     protected $container;
  13.     public function setContainer(ContainerInterface $container null)
  14.     {
  15.         $this->container $container;
  16.     }
  17.     public function onLateKernelRequest(RequestEvent $event)
  18.     {
  19.         $translatable $this->container->get('gedmo.listener.translatable');
  20.         $translatable->setTranslatableLocale($event->getRequest()->getLocale());
  21.     }
  22. }