vendor/pimcore/data-hub/src/PimcoreDataHubBundle.php line 25

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Commercial License (PCL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  *  @license    http://www.pimcore.org/license     GPLv3 and PCL
  13.  */
  14. namespace Pimcore\Bundle\DataHubBundle;
  15. use Pimcore\Bundle\DataHubBundle\DependencyInjection\Compiler\CustomDocumentTypePass;
  16. use Pimcore\Bundle\DataHubBundle\DependencyInjection\Compiler\ImportExportLocatorsPass;
  17. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  18. use Pimcore\Extension\Bundle\Installer\InstallerInterface;
  19. use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
  20. use Symfony\Component\DependencyInjection\ContainerBuilder;
  21. class PimcoreDataHubBundle extends AbstractPimcoreBundle
  22. {
  23.     use PackageVersionTrait;
  24.     const RUNTIME_CONTEXT_KEY 'datahub_context';
  25.     const NOT_ALLOWED_POLICY_EXCEPTION 1;
  26.     const NOT_ALLOWED_POLICY_NULL 2;
  27.     //TODO decide whether we want to return null here or throw an exception (maybe make this configurable?)
  28.     public static $notAllowedPolicy self::NOT_ALLOWED_POLICY_NULL;
  29.     /**
  30.      * @inheritDoc
  31.      */
  32.     public function build(ContainerBuilder $container)
  33.     {
  34.         $container->addCompilerPass(new ImportExportLocatorsPass());
  35.         $container->addCompilerPass(new CustomDocumentTypePass());
  36.     }
  37.     /**
  38.      * {@inheritdoc}
  39.      */
  40.     protected function getComposerPackageName(): string
  41.     {
  42.         return 'pimcore/data-hub';
  43.     }
  44.     /**
  45.      * @return array
  46.      */
  47.     public function getCssPaths()
  48.     {
  49.         return [
  50.             '/bundles/pimcoredatahub/css/icons.css',
  51.             '/bundles/pimcoredatahub/css/style.css'
  52.         ];
  53.     }
  54.     /**
  55.      * @return array
  56.      */
  57.     public function getJsPaths()
  58.     {
  59.         return [
  60.             '/bundles/pimcoredatahub/js/datahub.js',
  61.             '/bundles/pimcoredatahub/js/config.js',
  62.             '/bundles/pimcoredatahub/js/adapter/graphql.js',
  63.             '/bundles/pimcoredatahub/js/configuration/graphql/configItem.js',
  64.             '/bundles/pimcoredatahub/js/fieldConfigDialog.js',
  65.             '/bundles/pimcoredatahub/js/Abstract.js',
  66.             '/bundles/pimcoredatahub/js/mutationvalue/DefaultValue.js',
  67.             '/bundles/pimcoredatahub/js/queryvalue/DefaultValue.js',
  68.             '/bundles/pimcoredatahub/js/queryoperator/Alias.js',
  69.             '/bundles/pimcoredatahub/js/queryoperator/Concatenator.js',
  70.             '/bundles/pimcoredatahub/js/queryoperator/DateFormatter.js',
  71.             '/bundles/pimcoredatahub/js/queryoperator/ElementCounter.js',
  72.             '/bundles/pimcoredatahub/js/queryoperator/Text.js',
  73.             '/bundles/pimcoredatahub/js/queryoperator/Merge.js',
  74.             '/bundles/pimcoredatahub/js/queryoperator/Substring.js',
  75.             '/bundles/pimcoredatahub/js/queryoperator/Thumbnail.js',
  76.             '/bundles/pimcoredatahub/js/queryoperator/ThumbnailHtml.js',
  77.             '/bundles/pimcoredatahub/js/queryoperator/TranslateValue.js',
  78.             '/bundles/pimcoredatahub/js/queryoperator/Trimmer.js',
  79.             '/bundles/pimcoredatahub/js/mutationoperator/mutationoperator.js',
  80.             '/bundles/pimcoredatahub/js/mutationoperator/IfEmpty.js',
  81.             '/bundles/pimcoredatahub/js/mutationoperator/LocaleSwitcher.js',
  82.             '/bundles/pimcoredatahub/js/mutationoperator/LocaleCollector.js',
  83.             '/bundles/pimcoredatahub/js/workspace/abstract.js',
  84.             '/bundles/pimcoredatahub/js/workspace/document.js',
  85.             '/bundles/pimcoredatahub/js/workspace/asset.js',
  86.             '/bundles/pimcoredatahub/js/workspace/object.js'
  87.         ];
  88.     }
  89.     /**
  90.      * If the bundle has an installation routine, an installer is responsible of handling installation related tasks
  91.      *
  92.      * @return InstallerInterface|null
  93.      */
  94.     public function getInstaller()
  95.     {
  96.         return $this->container->get(Installer::class);
  97.     }
  98.     /**
  99.      * @return int
  100.      */
  101.     public static function getNotAllowedPolicy()
  102.     {
  103.         return self::$notAllowedPolicy;
  104.     }
  105.     /**
  106.      * @param mixed $notAllowedPolicy
  107.      */
  108.     public static function setNotAllowedPolicy($notAllowedPolicy): void
  109.     {
  110.         self::$notAllowedPolicy $notAllowedPolicy;
  111.     }
  112. }