vendor/w-vision/data-definitions/src/DataDefinitionsBundle/DataDefinitionsBundle.php line 40

Open in your IDE?
  1. <?php
  2. /**
  3.  * Data Definitions.
  4.  *
  5.  * LICENSE
  6.  *
  7.  * This source file is subject to the GNU General Public License version 3 (GPLv3)
  8.  * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
  9.  * files that are distributed with this source code.
  10.  *
  11.  * @copyright  Copyright (c) 2016-2019 w-vision AG (https://www.w-vision.ch)
  12.  * @license    https://github.com/w-vision/DataDefinitions/blob/master/gpl-3.0.txt GNU General Public License version 3 (GPLv3)
  13.  */
  14. namespace Wvision\Bundle\DataDefinitionsBundle;
  15. use CoreShop\Bundle\ResourceBundle\AbstractResourceBundle;
  16. use CoreShop\Bundle\ResourceBundle\ComposerPackageBundleInterface;
  17. use CoreShop\Bundle\ResourceBundle\CoreShopResourceBundle;
  18. use CoreShop\Bundle\RuleBundle\CoreShopRuleBundle;
  19. use Pimcore\Extension\Bundle\PimcoreBundleInterface;
  20. use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
  21. use Pimcore\HttpKernel\BundleCollection\BundleCollection;
  22. use Symfony\Component\DependencyInjection\ContainerBuilder;
  23. use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
  24. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\CleanerRegistryCompilerPass;
  25. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ExportProviderRegistryCompilerPass;
  26. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ExportRunnerRegistryCompilerPass;
  27. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\FetcherRegistryCompilerPass;
  28. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\FilterRegistryCompilerPass;
  29. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\GetterRegistryCompilerPass;
  30. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ImportRuleActionPass;
  31. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ImportRuleConditionPass;
  32. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\InterpreterRegistryCompilerPass;
  33. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\LoaderRegistryCompilerPass;
  34. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ProviderRegistryCompilerPass;
  35. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\RunnerRegistryCompilerPass;
  36. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\SetterRegistryCompilerPass;
  37. class DataDefinitionsBundle extends AbstractResourceBundle implements PimcoreBundleInterfaceComposerPackageBundleInterface
  38. {
  39.     use PackageVersionTrait;
  40.     /**
  41.      * {@inheritdoc}
  42.      */
  43.     public static function registerDependentBundles(BundleCollection $collection)
  44.     {
  45.         parent::registerDependentBundles($collection);
  46.         $collection->addBundles([
  47.             new CoreShopRuleBundle(),
  48.         ], 3500);
  49.     }
  50.     public function getContainerExtension()
  51.     {
  52.         if (null === $this->extension) {
  53.             $extension $this->createContainerExtension();
  54.             if (null !== $extension) {
  55.                 if (!$extension instanceof ExtensionInterface) {
  56.                     throw new \LogicException(sprintf('Extension %s must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.',
  57.                         get_class($extension)));
  58.                 }
  59.                 $this->extension $extension;
  60.             } else {
  61.                 $this->extension false;
  62.             }
  63.         }
  64.         if ($this->extension) {
  65.             return $this->extension;
  66.         }
  67.     }
  68.     /**
  69.      * {@inheritdoc}
  70.      */
  71.     public function getPackageName()
  72.     {
  73.         return 'w-vision/data-definitions';
  74.     }
  75.     /**
  76.      * {@inheritdoc}
  77.      */
  78.     public function getSupportedDrivers()
  79.     {
  80.         return [
  81.             CoreShopResourceBundle::DRIVER_PIMCORE,
  82.         ];
  83.     }
  84.     /**
  85.      * {@inheritdoc}
  86.      */
  87.     public function build(ContainerBuilder $builder)
  88.     {
  89.         parent::build($builder);
  90.         $builder->addCompilerPass(new CleanerRegistryCompilerPass());
  91.         $builder->addCompilerPass(new FilterRegistryCompilerPass());
  92.         $builder->addCompilerPass(new InterpreterRegistryCompilerPass());
  93.         $builder->addCompilerPass(new ProviderRegistryCompilerPass());
  94.         $builder->addCompilerPass(new RunnerRegistryCompilerPass());
  95.         $builder->addCompilerPass(new SetterRegistryCompilerPass());
  96.         $builder->addCompilerPass(new LoaderRegistryCompilerPass());
  97.         $builder->addCompilerPass(new GetterRegistryCompilerPass());
  98.         $builder->addCompilerPass(new FetcherRegistryCompilerPass());
  99.         $builder->addCompilerPass(new ExportProviderRegistryCompilerPass());
  100.         $builder->addCompilerPass(new ExportRunnerRegistryCompilerPass());
  101.         $builder->addCompilerPass(new ImportRuleConditionPass());
  102.         $builder->addCompilerPass(new ImportRuleActionPass());
  103.     }
  104.     /**
  105.      * {@inheritdoc}
  106.      */
  107.     public function getNiceName()
  108.     {
  109.         return 'Data Definitions';
  110.     }
  111.     /**
  112.      * {@inheritdoc}
  113.      */
  114.     public function getDescription()
  115.     {
  116.         return 'Data Definitions allows you to create reusable Definitions for Importing all kinds of data into DataObjects.';
  117.     }
  118.     /**
  119.      * {@inheritdoc}
  120.      */
  121.     protected function getComposerPackageName()
  122.     {
  123.         return 'w-vision/data-definitions';
  124.     }
  125.     public function getInstaller()
  126.     {
  127.         return $this->container->get(Installer::class);
  128.     }
  129.     /**
  130.      * {@inheritdoc}
  131.      */
  132.     public function getAdminIframePath()
  133.     {
  134.         return null;
  135.     }
  136.     /**
  137.      * {@inheritdoc}
  138.      */
  139.     public function getJsPaths()
  140.     {
  141.         return [];
  142.     }
  143.     /**
  144.      * {@inheritdoc}
  145.      */
  146.     public function getCssPaths()
  147.     {
  148.         return [];
  149.     }
  150.     /**
  151.      * {@inheritdoc}
  152.      */
  153.     public function getEditmodeJsPaths()
  154.     {
  155.         return [];
  156.     }
  157.     /**
  158.      * {@inheritdoc}
  159.      */
  160.     public function getEditmodeCssPaths()
  161.     {
  162.         return [];
  163.     }
  164. }