<?php
namespace App\EventListener\Client\SellPrice;
use App\Entity\Client\Sell\SellPrice;
use App\EventListener\GenericEvent;
use App\Service\Client\SellPrice\SellPriceManager;
class SellPriceListener
{
private $sellPriceManager;
public function __construct(SellPriceManager $sellPriceManager)
{
$this->sellPriceManager = $sellPriceManager;
}
public function pre(GenericEvent $genericEvent)
{
$sellPrice = $genericEvent->getSubject();
if (!$sellPrice instanceof SellPrice) {
return;
}
$this->sellPriceManager->pre($sellPrice);
}
public function post(GenericEvent $genericEvent)
{
$sellPrice = $genericEvent->getSubject();
if (!$sellPrice instanceof SellPrice) {
return;
}
$this->sellPriceManager->post($sellPrice);
}
}