<?php

namespace Lc\SovBundle\Event\EntityManager;

use Lc\SovBundle\Doctrine\EntityInterface;
use Symfony\Contracts\EventDispatcher\Event;

/**
 * class EntityEvent.
 *
 * @author Simon Vieille <simon@deblan.fr>
 */
class EntityManagerEvent extends Event
{
    const PRE_CREATE_EVENT = 'entity_manager_event.pre_create';
    const POST_CREATE_EVENT = 'entity_manager_event.post_create';
    const PRE_UPDATE_EVENT = 'entity_manager_event.pre_update';
    const POST_UPDATE_EVENT = 'entity_manager_event.post_update';
    const PRE_DELETE_EVENT = 'entity_manager_event.pre_delete';
    const POST_DELETE_EVENT = 'entity_manager_event.post_delete';

    protected EntityInterface $entity;

    public function __construct(EntityInterface $entity)
    {
        $this->entity = $entity;
    }

    public function getEntity(): EntityInterface
    {
        return $this->entity;
    }
}
