1
0
mirror of synced 2025-01-30 12:01:44 +03:00

Merge branch 'DDC-2187'

This commit is contained in:
Benjamin Eberlei 2012-12-24 10:15:47 +01:00
commit 7cf26950cc
3 changed files with 9 additions and 62 deletions

View File

@ -19,8 +19,8 @@
namespace Doctrine\ORM\Event; namespace Doctrine\ORM\Event;
use Doctrine\Common\EventArgs;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs as BaseLifecycleEventArgs;
/** /**
* Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions * 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 Roman Borschel <roman@code-factory.de>
* @author Benjamin Eberlei <kontakt@beberlei.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. * Retrieves associated Entity.
* *
@ -62,7 +40,7 @@ class LifecycleEventArgs extends EventArgs
*/ */
public function getEntity() public function getEntity()
{ {
return $this->entity; return $this->getObject();
} }
/** /**
@ -72,6 +50,6 @@ class LifecycleEventArgs extends EventArgs
*/ */
public function getEntityManager() 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\Common\EventArgs;
use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs as BaseLoadClassMetadataEventArgs;
/** /**
* Class that holds event arguments for a loadMetadata event. * Class that holds event arguments for a loadMetadata event.
@ -29,47 +30,15 @@ use Doctrine\ORM\EntityManager;
* @author Jonathan H. Wage <jonwage@gmail.com> * @author Jonathan H. Wage <jonwage@gmail.com>
* @since 2.0 * @since 2.0
*/ */
class LoadClassMetadataEventArgs extends EventArgs class LoadClassMetadataEventArgs extends BaseLoadClassMetadataEventArgs
{ {
/** /**
* @var \Doctrine\ORM\Mapping\ClassMetadata * Retrieve associated EntityManager.
*/
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.
* *
* @return \Doctrine\ORM\EntityManager * @return \Doctrine\ORM\EntityManager
*/ */
public function getEntityManager() public function getEntityManager()
{ {
return $this->em; return $this->getObjectManager();
} }
} }

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