/**
  * @param ContainerInterface|null $container
  */
 public function setContainer(ContainerInterface $container = null)
 {
     $this->container = $container;
     $this->setTranslator($container->get('translator'));
     $this->entityManager = $container->get('doctrine.entitymanager');
     $this->schemaTool = $container->get('zikula.doctrine.schema_tool');
     $this->extensionName = $this->name;
     // for ExtensionVariablesTrait
     $this->variableApi = $container->get('zikula_extensions_module.api.variable');
     // for ExtensionVariablesTrait
     $this->hookApi = $container->get('zikula_extensions_module.api.hook');
     if ($this->bundle) {
         $container->get('translator')->setDomain($this->bundle->getTranslationDomain());
     }
 }
예제 #2
0
 /**
  * Constructor.
  *
  * @param AbstractBundle $bundle
  *            A AbstractBundle instance
  * @throws \InvalidArgumentException
  */
 public function __construct(AbstractBundle $bundle)
 {
     $this->name = $bundle->getName();
     $this->translator = $bundle->getContainer()->get('translator');
     $this->translator->setDomain($bundle->getTranslationDomain());
     $this->boot($bundle);
 }
예제 #3
0
 /**
  * Constructor.
  *
  * @param AbstractBundle $bundle
  *            A AbstractBundle instance
  * @throws \InvalidArgumentException
  */
 public function __construct(AbstractBundle $bundle)
 {
     $this->name = $bundle->getName();
     $this->extensionName = $this->name;
     // for ExtensionVariablesTrait
     $this->variableApi = $bundle->getContainer()->get('zikula_extensions_module.api.variable');
     // for ExtensionVariablesTrait
     $this->setTranslator($bundle->getContainer()->get('translator'));
     $this->translator->setDomain($bundle->getTranslationDomain());
     $this->boot($bundle);
 }