src/EventSubscriber/Order/NotifyAdminOrderReadyToAssignSubscriber.php line 35
<?php/** This file is part of the Pellipop project.** (c) Mobizel** For the full copyright and license information, please view the LICENSE* file that was distributed with this source code.*/declare(strict_types=1);namespace App\EventSubscriber\Order;use App\Entity\Order\Order;use App\Message\SendOrderEmailMessage;use Symfony\Component\EventDispatcher\EventSubscriberInterface;use Symfony\Component\Messenger\MessageBusInterface;use Symfony\Component\Workflow\Event\Event;/*** Notifie l'admin quand une commande devient prête à assigner (photos_received) — async.* Ce même événement se produit aussi en mode Fuji : ne rien faire si le workflow* imprimeurs internes n'est pas actif, pour ne pas notifier des commandes Fuji.*/final class NotifyAdminOrderReadyToAssignSubscriber implements EventSubscriberInterface{public function __construct(private MessageBusInterface $messageBus,private bool $printerWorkflowEnabled,) {}public function onEnter(Event $event): void{if (!$this->printerWorkflowEnabled) {return;}/** @var Order $order */$order = $event->getSubject();$orderId = $order->getId();if (null === $orderId) {return;}$this->messageBus->dispatch(new SendOrderEmailMessage($orderId,SendOrderEmailMessage::TYPE_ADMIN_READY_TO_ASSIGN,));}public static function getSubscribedEvents(): array{return ['workflow.order_production.entered.photos_received' => 'onEnter',];}}