<?php
namespace App\EventListener\Client\Store;
use App\Entity\Client\Store\Store;
use App\EventListener\GenericEvent;
use App\Service\Client\Store\StoreManager;
class StoreListener
{
private StoreManager $storeManager;
public function __construct(StoreManager $storeManager)
{
$this->storeManager = $storeManager;
}
public function post(GenericEvent $genericEvent)
{
if (!$genericEvent->getSubject() instanceof Store) {
return;
}
$this->storeManager->post($genericEvent->getSubject());
}
}