vendor/shopware/core/Framework/App/Subscriber/AppLoadedSubscriber.php line 18

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\App\Subscriber;
  3. use Shopware\Core\Framework\App\AppEntity;
  4. use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityLoadedEvent;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. class AppLoadedSubscriber implements EventSubscriberInterface
  7. {
  8.     public static function getSubscribedEvents(): array
  9.     {
  10.         return [
  11.             'app.loaded' => 'unserialize',
  12.         ];
  13.     }
  14.     public function unserialize(EntityLoadedEvent $event): void
  15.     {
  16.         /** @var AppEntity $app */
  17.         foreach ($event->getEntities() as $app) {
  18.             $iconRaw $app->getIconRaw();
  19.             if ($iconRaw !== null) {
  20.                 $app->setIcon(base64_encode($iconRaw));
  21.             }
  22.         }
  23.     }
  24. }