vendor/shopware/core/Framework/App/FlowAction/AppFlowActionLoadedSubscriber.php line 21

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