src/EventSubscriber/ShopIntegrationPlatform/InventorySubscriber.php line 37
<?phpnamespace App\EventSubscriber\ShopIntegrationPlatform;use App\Entity\Product;use App\Entity\ShopIntegrationPlatform\SipRequestLogger;use App\Event\InventoryQuantityUpdatedEvent;use Symfony\Component\EventDispatcher\EventSubscriberInterface;use App\ShopIntegrationPlatform\Actions\Api\MassSentRequests\AddRequestAction;use App\Helper\Common;class InventorySubscriber implements EventSubscriberInterface{/*** @param AddRequestAction $addRequestAction*/public function __construct(private readonly AddRequestAction $addRequestAction,){}/*** @return array*/public static function getSubscribedEvents(): array{return [InventoryQuantityUpdatedEvent::class => 'inventoryQuantityUpdated'];}/*** @param InventoryQuantityUpdatedEvent $event* @return void*/public function inventoryQuantityUpdated(InventoryQuantityUpdatedEvent $event): void{$this->addRequestAction->run(shop: $event->getInventory()->getShop(),product: $event->getInventory()->getProduct(),entityName: Common::getClassNameWithoutNamespace(Product::class),entityId: $event->getInventory()->getProduct()->getId(),commandName: SipRequestLogger::COMMAND_UPDATE_INVENTORY);}}