vendor/pimcore/portal-engine/src/EventSubscriber/AdminSettingsSubscriber.php line 38

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under following license:
  6.  * - Pimcore Commercial License (PCL)
  7.  *
  8.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  9.  *  @license    http://www.pimcore.org/license     PCL
  10.  */
  11. namespace Pimcore\Bundle\PortalEngineBundle\EventSubscriber;
  12. use Pimcore\Event\Admin\IndexActionSettingsEvent;
  13. use Pimcore\Event\AdminEvents;
  14. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  15. class AdminSettingsSubscriber implements EventSubscriberInterface
  16. {
  17.     /**
  18.      * @var array
  19.      */
  20.     protected $possiblePortalDomains = [];
  21.     public function __construct(array $possiblePortalDomains)
  22.     {
  23.         $this->possiblePortalDomains $possiblePortalDomains;
  24.     }
  25.     public static function getSubscribedEvents()
  26.     {
  27.         return [
  28.             AdminEvents::INDEX_ACTION_SETTINGS => 'getSettings',
  29.         ];
  30.     }
  31.     public function getSettings(IndexActionSettingsEvent $event)
  32.     {
  33.         if (!empty($this->possiblePortalDomains)) {
  34.             $event->addSetting('portalEngine', ['possiblePortalDomains' => $this->possiblePortalDomains]);
  35.         }
  36.     }
  37. }