1
0
mirror of synced 2025-01-18 22:41:43 +03:00

use base events

This commit is contained in:
Klein Florian 2012-12-05 14:26:22 +01:00 committed by Benjamin Eberlei
parent e319e34783
commit 8443eee628
3 changed files with 9 additions and 62 deletions

View File

@ -19,8 +19,8 @@
namespace Doctrine\ORM\Event;
use Doctrine\Common\EventArgs;
use Doctrine\ORM\EntityManager;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs as BaseLifecycleEventArgs;
/**
* Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions
@ -31,30 +31,8 @@ use Doctrine\ORM\EntityManager;
* @author Roman Borschel <roman@code-factory.de>
* @author Benjamin Eberlei <kontakt@beberlei.de>
*/
class LifecycleEventArgs extends EventArgs
class LifecycleEventArgs extends BaseLifecycleEventArgs
{
/**
* @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.
*
@ -62,7 +40,7 @@ class LifecycleEventArgs extends EventArgs
*/
public function getEntity()
{
return $this->entity;
return $this->getObject();
}
/**
@ -72,6 +50,6 @@ class LifecycleEventArgs extends EventArgs
*/
public function getEntityManager()
{
return $this->em;
return $this->getObjectManager();
}
}

View File

@ -22,6 +22,7 @@ namespace Doctrine\ORM\Event;
use Doctrine\Common\EventArgs;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\EntityManager;
use Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs as BaseLoadClassMetadataEventArgs;
/**
* Class that holds event arguments for a loadMetadata event.
@ -29,47 +30,15 @@ use Doctrine\ORM\EntityManager;
* @author Jonathan H. Wage <jonwage@gmail.com>
* @since 2.0
*/
class LoadClassMetadataEventArgs extends EventArgs
class LoadClassMetadataEventArgs extends BaseLoadClassMetadataEventArgs
{
/**
* @var \Doctrine\ORM\Mapping\ClassMetadata
*/
private $classMetadata;
/**
* @var \Doctrine\ORM\EntityManager
*/
private $em;
/**
* Constructor.
*
* @param ClassMetadataInfo $classMetadata
* @param EntityManager $em
*/
public function __construct(ClassMetadataInfo $classMetadata, EntityManager $em)
{
$this->classMetadata = $classMetadata;
$this->em = $em;
}
/**
* Retrieves associated ClassMetadata.
*
* @return \Doctrine\ORM\Mapping\ClassMetadataInfo
*/
public function getClassMetadata()
{
return $this->classMetadata;
}
/**
* Retrieves associated EntityManager.
* Retrieve associated EntityManager.
*
* @return \Doctrine\ORM\EntityManager
*/
public function getEntityManager()
{
return $this->em;
return $this->getObjectManager();
}
}

@ -1 +1 @@
Subproject commit 30b8cea3bfe22f5eb58b5b0165f21df750aeb2e2
Subproject commit d514e3920656921ba1148f16a4089222c58bc83a