. */ namespace Doctrine\ORM\Event; use Doctrine\Common\EventArgs; use Doctrine\ORM\EntityManager; /** * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions * of entities. * * @link www.doctrine-project.org * @since 2.0 * @author Roman Borschel * @author Benjamin Eberlei */ class LifecycleEventArgs extends EventArgs { /** * @var \Doctrine\ORM\EntityManager */ private $em; /** * @var object */ private $entity; /** * Constructor. * * @param object $entity * @param EntityManager $em */ public function __construct($entity, EntityManager $em) { $this->entity = $entity; $this->em = $em; } /** * Retrieves associated Entity. * * @return object */ public function getEntity() { return $this->entity; } /** * Retrieves associated EntityManager. * * @return \Doctrine\ORM\EntityManager */ public function getEntityManager() { return $this->em; } }