<?php
namespace App\EventListener\Client\Store;
use App\Entity\Client\Store\StoreStockGroup;
use App\EventListener\GenericEvent;
use App\Service\Client\Store\StoreStockGroupManager;
class StoreStockGroupListener
{
private StoreStockGroupManager $storeStockGroupManager;
public function __construct(StoreStockGroupManager $storeStockGroupManager)
{
$this->storeStockGroupManager = $storeStockGroupManager;
}
public function change(GenericEvent $genericEvent)
{
$storeStockGroup = $genericEvent->getSubject();
if (!$storeStockGroup instanceof StoreStockGroup) {
return;
}
$this->storeStockGroupManager->change($storeStockGroup);
}
}