src/PortoContainers/Zapier/EventSubscriber/InventorySubscriber.php line 36
<?phpnamespace App\PortoContainers\Zapier\EventSubscriber;use App\Event\InventoryQuantityUpdatedEvent;use App\PortoContainers\Zapier\Actions\AddTriggerAction;use App\PortoContainers\Zapier\DTO\ZapierTriggerData;use App\PortoContainers\Zapier\Entities\ZapierTrigger;use Symfony\Component\EventDispatcher\EventSubscriberInterface;class InventorySubscriber implements EventSubscriberInterface{/*** @param AddTriggerAction $addTriggerAction*/public function __construct(private readonly AddTriggerAction $addTriggerAction){}/*** @return array*/public static function getSubscribedEvents(): array{return [InventoryQuantityUpdatedEvent::class => ['inventoryQuantityUpdated', -100],];}/*** @param InventoryQuantityUpdatedEvent $event* @return void* @throws \Exception*/public function inventoryQuantityUpdated(InventoryQuantityUpdatedEvent $event): void{$this->addTriggerAction->run(new ZapierTriggerData(ZapierTrigger::TRIGGER_INVENTORY_UPDATED,$event->getInventory()->getId()));}}