vendor/shopware/core/Framework/Plugin/Subscriber/PluginLoadedSubscriber.php line 24

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\Plugin\Subscriber;
  3. use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityLoadedEvent;
  4. use Shopware\Core\Framework\Plugin\PluginEntity;
  5. use Shopware\Core\Framework\Plugin\PluginEvents;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. /**
  8.  * @deprecated tag:v6.5.0 - reason:becomes-internal - EventSubscribers will become internal in v6.5.0
  9.  */
  10. class PluginLoadedSubscriber implements EventSubscriberInterface
  11. {
  12.     public static function getSubscribedEvents(): array
  13.     {
  14.         return [
  15.             PluginEvents::PLUGIN_LOADED_EVENT => [
  16.                 ['unserialize'],
  17.             ],
  18.         ];
  19.     }
  20.     public function unserialize(EntityLoadedEvent $event): void
  21.     {
  22.         /** @var PluginEntity $plugin */
  23.         foreach ($event->getEntities() as $plugin) {
  24.             if ($plugin->getIconRaw()) {
  25.                 $plugin->setIcon(base64_encode($plugin->getIconRaw()));
  26.             }
  27.         }
  28.     }
  29. }