vendor/pimcore/data-hub/src/EventListener/AdminListener.php line 34

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\EventListener;
  15. use Pimcore\Bundle\AdminBundle\Event\IndexActionSettingsEvent;
  16. class AdminListener
  17. {
  18.     private array $config;
  19.     public function __construct(array $config)
  20.     {
  21.         $this->config $config;
  22.     }
  23.     /**
  24.      * Handles INDEX_ACTION_SETTINGS event and adds custom admin UI settings
  25.      *
  26.      * @param IndexActionSettingsEvent $event
  27.      */
  28.     public function addIndexSettings(IndexActionSettingsEvent $event)
  29.     {
  30.         $event->addSetting('data-hub-writeable', (new \Pimcore\Bundle\DataHubBundle\Configuration(nullnull))->isWriteable());
  31.         $allowIntrospection true;
  32.         if (isset($this->config['graphql']) && isset($this->config['graphql']['allow_introspection'])) {
  33.             $allowIntrospection $this->config['graphql']['allow_introspection'];
  34.         }
  35.         $event->addSetting('allow_introspection'$allowIntrospection);
  36.     }
  37. }