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/configItem.js',
  61.             '/bundles/pimcoredatahub/js/fieldConfigDialog.js',
  62.             '/bundles/pimcoredatahub/js/Abstract.js',
  63.             '/bundles/pimcoredatahub/js/mutationvalue/DefaultValue.js',
  64.             '/bundles/pimcoredatahub/js/queryvalue/DefaultValue.js',
  65.             '/bundles/pimcoredatahub/js/Abstract.js',
  66.             '/bundles/pimcoredatahub/js/queryoperator/Alias.js',
  67.             '/bundles/pimcoredatahub/js/queryoperator/Concatenator.js',
  68.             '/bundles/pimcoredatahub/js/queryoperator/DateFormatter.js',
  69.             '/bundles/pimcoredatahub/js/queryoperator/ElementCounter.js',
  70.             '/bundles/pimcoredatahub/js/queryoperator/Text.js',
  71.             '/bundles/pimcoredatahub/js/queryoperator/Merge.js',
  72.             '/bundles/pimcoredatahub/js/queryoperator/Substring.js',
  73.             '/bundles/pimcoredatahub/js/queryoperator/Thumbnail.js',
  74.             '/bundles/pimcoredatahub/js/queryoperator/ThumbnailHtml.js',
  75.             '/bundles/pimcoredatahub/js/queryoperator/TranslateValue.js',
  76.             '/bundles/pimcoredatahub/js/queryoperator/Trimmer.js',
  77.             '/bundles/pimcoredatahub/js/mutationoperator/IfEmpty.js',
  78.             '/bundles/pimcoredatahub/js/mutationoperator/LocaleSwitcher.js',
  79.             '/bundles/pimcoredatahub/js/workspace/abstract.js',
  80.             '/bundles/pimcoredatahub/js/workspace/document.js',
  81.             '/bundles/pimcoredatahub/js/workspace/asset.js',
  82.             '/bundles/pimcoredatahub/js/workspace/object.js'
  83.         ];
  84.     }
  85.     /**
  86.      * If the bundle has an installation routine, an installer is responsible of handling installation related tasks
  87.      *
  88.      * @return InstallerInterface|null
  89.      */
  90.     public function getInstaller()
  91.     {
  92.         return $this->container->get(Installer::class);
  93.     }
  94.     /**
  95.      * @return mixed
  96.      */
  97.     public static function getNotAllowedPolicy()
  98.     {
  99.         return self::$notAllowedPolicy;
  100.     }
  101.     /**
  102.      * @param mixed $notAllowedPolicy
  103.      */
  104.     public static function setNotAllowedPolicy($notAllowedPolicy): void
  105.     {
  106.         self::$notAllowedPolicy $notAllowedPolicy;
  107.     }
  108. }