src/EventSubscriber/Order/ValidateReceivePhotosSubscriber.php line 30
<?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\Entity\Order\OrderItemPhoto;use App\Message\ApplyPhotosReceiveTransitionMessage;use Symfony\Component\EventDispatcher\EventSubscriberInterface;use Symfony\Component\Messenger\MessageBusInterface;use Symfony\Component\Workflow\Event\Event;class ValidateReceivePhotosSubscriber implements EventSubscriberInterface{public function __construct(private MessageBusInterface $messageBus,) {}public function onCompleted(Event $event){/** @var OrderItemPhoto $orderItemPhoto */$orderItemPhoto = $event->getSubject();/** @var Order $order */$order = $orderItemPhoto->getOrderItem()->getOrder();$this->messageBus->dispatch(new ApplyPhotosReceiveTransitionMessage($order->getId()));}public static function getSubscribedEvents(){return ['workflow.photo.completed.production' => 'onCompleted',];}}