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

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