. */ 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 \Doctrine\ORM\EntityManager $em */ public function __construct($entity, EntityManager $em) { $this->entity = $entity; $this->em = $em; } /** * Retireve associated Entity. * * @return object */ public function getEntity() { return $this->entity; } /** * Retrieve associated EntityManager. * * @return \Doctrine\ORM\EntityManager */ public function getEntityManager() { return $this->em; } }