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

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