src/Essesolutions/Z3950Bundle/EventListener/Admin/SettingEventListener.php line 30

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Essesolutions\Z3950Bundle\EventListener\Admin;
  4. use App\Essesolutions\Z3950Bundle\Configuration\ConfigurationAwareInterface;
  5. use App\Essesolutions\Z3950Bundle\Configuration\ConfigurationAwareTrait;
  6. use Pimcore\Event\Admin\IndexActionSettingsEvent;
  7. use Pimcore\Event\AdminEvents;
  8. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  9. class SettingEventListener implements EventSubscriberInterfaceConfigurationAwareInterface
  10. {
  11.     use ConfigurationAwareTrait;
  12.     
  13.     /** @inheritDoc */
  14.     public static function getSubscribedEvents(): array
  15.     {
  16.         return [
  17.             AdminEvents::INDEX_ACTION_SETTINGS => 'onSettings'
  18.         ];
  19.     }
  20.     
  21.     /**
  22.      * @param IndexActionSettingsEvent $event
  23.      *
  24.      * @return void
  25.      */
  26.     public function onSettings(IndexActionSettingsEvent $event)
  27.     {
  28.         $event->addSetting('essesolutions_z3950', [
  29.             'import' => [
  30.                 'configs' => array_keys($this->z3950Configuration->getImportConfigsName()),
  31.             ]
  32.         ]);
  33.     }
  34. }