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

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 Pimcore\Extension\Bundle\PimcoreBundleInterface;
  19. use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
  20. use Symfony\Component\DependencyInjection\ContainerBuilder;
  21. use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
  22. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\CleanerRegistryCompilerPass;
  23. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ExportProviderRegistryCompilerPass;
  24. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ExportRunnerRegistryCompilerPass;
  25. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\FetcherRegistryCompilerPass;
  26. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\FilterRegistryCompilerPass;
  27. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\GetterRegistryCompilerPass;
  28. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\InterpreterRegistryCompilerPass;
  29. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\LoaderRegistryCompilerPass;
  30. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ProviderRegistryCompilerPass;
  31. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\RunnerRegistryCompilerPass;
  32. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\SetterRegistryCompilerPass;
  33. class DataDefinitionsBundle extends AbstractResourceBundle implements PimcoreBundleInterfaceComposerPackageBundleInterface
  34. {
  35.     use PackageVersionTrait;
  36.     public function getContainerExtension()
  37.     {
  38.         if (null === $this->extension) {
  39.             $extension $this->createContainerExtension();
  40.             if (null !== $extension) {
  41.                 if (!$extension instanceof ExtensionInterface) {
  42.                     throw new \LogicException(sprintf('Extension %s must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.',
  43.                         get_class($extension)));
  44.                 }
  45.                 $this->extension $extension;
  46.             } else {
  47.                 $this->extension false;
  48.             }
  49.         }
  50.         if ($this->extension) {
  51.             return $this->extension;
  52.         }
  53.     }
  54.     /**
  55.      * {@inheritdoc}
  56.      */
  57.     public function getPackageName()
  58.     {
  59.         return 'w-vision/data-definitions';
  60.     }
  61.     /**
  62.      * {@inheritdoc}
  63.      */
  64.     public function getSupportedDrivers()
  65.     {
  66.         return [
  67.             CoreShopResourceBundle::DRIVER_PIMCORE,
  68.         ];
  69.     }
  70.     /**
  71.      * {@inheritdoc}
  72.      */
  73.     public function build(ContainerBuilder $builder)
  74.     {
  75.         parent::build($builder);
  76.         $builder->addCompilerPass(new CleanerRegistryCompilerPass());
  77.         $builder->addCompilerPass(new FilterRegistryCompilerPass());
  78.         $builder->addCompilerPass(new InterpreterRegistryCompilerPass());
  79.         $builder->addCompilerPass(new ProviderRegistryCompilerPass());
  80.         $builder->addCompilerPass(new RunnerRegistryCompilerPass());
  81.         $builder->addCompilerPass(new SetterRegistryCompilerPass());
  82.         $builder->addCompilerPass(new LoaderRegistryCompilerPass());
  83.         $builder->addCompilerPass(new GetterRegistryCompilerPass());
  84.         $builder->addCompilerPass(new FetcherRegistryCompilerPass());
  85.         $builder->addCompilerPass(new ExportProviderRegistryCompilerPass());
  86.         $builder->addCompilerPass(new ExportRunnerRegistryCompilerPass());
  87.     }
  88.     /**
  89.      * {@inheritdoc}
  90.      */
  91.     public function getNiceName()
  92.     {
  93.         return 'Data Definitions';
  94.     }
  95.     /**
  96.      * {@inheritdoc}
  97.      */
  98.     public function getDescription()
  99.     {
  100.         return 'Data Definitions allows you to create reusable Definitions for Importing all kinds of data into DataObjects.';
  101.     }
  102.     /**
  103.      * {@inheritdoc}
  104.      */
  105.     protected function getComposerPackageName()
  106.     {
  107.         return 'w-vision/data-definitions';
  108.     }
  109.     public function getInstaller()
  110.     {
  111.         return $this->container->get(Installer::class);
  112.     }
  113.     /**
  114.      * {@inheritdoc}
  115.      */
  116.     public function getAdminIframePath()
  117.     {
  118.         return null;
  119.     }
  120.     /**
  121.      * {@inheritdoc}
  122.      */
  123.     public function getJsPaths()
  124.     {
  125.         return [];
  126.     }
  127.     /**
  128.      * {@inheritdoc}
  129.      */
  130.     public function getCssPaths()
  131.     {
  132.         return [];
  133.     }
  134.     /**
  135.      * {@inheritdoc}
  136.      */
  137.     public function getEditmodeJsPaths()
  138.     {
  139.         return [];
  140.     }
  141.     /**
  142.      * {@inheritdoc}
  143.      */
  144.     public function getEditmodeCssPaths()
  145.     {
  146.         return [];
  147.     }
  148. }