<?php
namespace App\EventSubscriber\Vignette;
use App\Events\Vignette\LogVignetteEvent;
use App\Service\Vignette\LogVignetteService;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class LogVignetteSubscriber implements EventSubscriberInterface
{
/** @var LogVignetteService */
protected $logVignetteService;
public function __construct(LogVignetteService $logVignetteService)
{
$this->logVignetteService = $logVignetteService;
}
public static function getSubscribedEvents()
{
return
[
LogVignetteEvent::LOG_OP_VIGNETTE_EDIT => 'onOpVignetteEdit',
LogVignetteEvent::LOG_OP_VIGNETTE_ORDER => 'onOpVignetteOrder'
];
}
public function onOpVignetteEdit(LogVignetteEvent $logVignetteEvent)
{
$this->logVignetteService->logNewOpVignetteEdit($logVignetteEvent);
}
public function onOpVignetteOrder(LogVignetteEvent $logVignetteEvent)
{
$this->logVignetteService->logNewOpVignetteOrder($logVignetteEvent);
}
}