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

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. declare(strict_types=1);
  15. namespace Wvision\Bundle\DataDefinitionsBundle;
  16. use Composer\InstalledVersions;
  17. use CoreShop\Bundle\ResourceBundle\AbstractResourceBundle;
  18. use CoreShop\Bundle\ResourceBundle\CoreShopResourceBundle;
  19. use CoreShop\Bundle\RuleBundle\CoreShopRuleBundle;
  20. use Pimcore\Extension\Bundle\Installer\InstallerInterface;
  21. use Pimcore\Extension\Bundle\PimcoreBundleInterface;
  22. use Pimcore\HttpKernel\BundleCollection\BundleCollection;
  23. use Symfony\Component\DependencyInjection\ContainerBuilder;
  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\PersisterRegistryCompilerPass;
  35. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ProviderRegistryCompilerPass;
  36. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\RunnerRegistryCompilerPass;
  37. use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\SetterRegistryCompilerPass;
  38. class DataDefinitionsBundle extends AbstractResourceBundle
  39. {
  40.     public static function registerDependentBundles(BundleCollection $collection): void
  41.     {
  42.         parent::registerDependentBundles($collection);
  43.         $collection->addBundles([
  44.             new CoreShopRuleBundle(),
  45.         ], 3500);
  46.     }
  47.     public function getSupportedDrivers(): array
  48.     {
  49.         return [
  50.             CoreShopResourceBundle::DRIVER_PIMCORE,
  51.         ];
  52.     }
  53.     public function build(ContainerBuilder $builder): void
  54.     {
  55.         parent::build($builder);
  56.         $builder->addCompilerPass(new CleanerRegistryCompilerPass());
  57.         $builder->addCompilerPass(new FilterRegistryCompilerPass());
  58.         $builder->addCompilerPass(new InterpreterRegistryCompilerPass());
  59.         $builder->addCompilerPass(new ProviderRegistryCompilerPass());
  60.         $builder->addCompilerPass(new RunnerRegistryCompilerPass());
  61.         $builder->addCompilerPass(new SetterRegistryCompilerPass());
  62.         $builder->addCompilerPass(new LoaderRegistryCompilerPass());
  63.         $builder->addCompilerPass(new GetterRegistryCompilerPass());
  64.         $builder->addCompilerPass(new FetcherRegistryCompilerPass());
  65.         $builder->addCompilerPass(new ExportProviderRegistryCompilerPass());
  66.         $builder->addCompilerPass(new ExportRunnerRegistryCompilerPass());
  67.         $builder->addCompilerPass(new ImportRuleConditionPass());
  68.         $builder->addCompilerPass(new ImportRuleActionPass());
  69.         $builder->addCompilerPass(new PersisterRegistryCompilerPass());
  70.     }
  71.     public function getVersion(): string
  72.     {
  73.         if (InstalledVersions::isInstalled('w-vision/data-definitions')) {
  74.             return InstalledVersions::getVersion('w-vision/data-definitions');
  75.         }
  76.         return '';
  77.     }
  78.     public function getNiceName(): string
  79.     {
  80.         return 'Data Definitions';
  81.     }
  82.     public function getDescription(): string
  83.     {
  84.         return 'Data Definitions allows you to create reusable Definitions for Importing all kinds of data into DataObjects.';
  85.     }
  86.     public function getInstaller(): ?InstallerInterface
  87.     {
  88.         return $this->container->get(Installer::class);
  89.     }
  90.     public function getAdminIframePath(): ?string
  91.     {
  92.         return null;
  93.     }
  94.     public function getJsPaths(): array
  95.     {
  96.         return [];
  97.     }
  98.     public function getCssPaths(): array
  99.     {
  100.         return [];
  101.     }
  102.     public function getEditmodeJsPaths(): array
  103.     {
  104.         return [];
  105.     }
  106.     public function getEditmodeCssPaths(): array
  107.     {
  108.         return [];
  109.     }
  110. }