1
0
Fork 0
mirror of synced 2025-04-03 13:23:37 +03:00

#385 #1181 DDC-3385 - extending OnClassMetadataNotFoundEventArgs from ManagerEventArgs instead of generic EventArgs

This commit is contained in:
Marco Pivetta 2015-01-13 20:56:21 +01:00
parent 6021e3a1b8
commit 762e798d22

View file

@ -20,7 +20,9 @@
namespace Doctrine\ORM\Event; namespace Doctrine\ORM\Event;
use Doctrine\Common\EventArgs; use Doctrine\Common\EventArgs;
use Doctrine\Common\Persistence\Event\ManagerEventArgs;
use Doctrine\Common\Persistence\Mapping\ClassMetadata; use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@ -33,18 +35,13 @@ use Doctrine\ORM\EntityManagerInterface;
* @author Marco Pivetta <ocramius@gmail.com> * @author Marco Pivetta <ocramius@gmail.com>
* @since 2.5 * @since 2.5
*/ */
class OnClassMetadataNotFoundEventArgs extends EventArgs class OnClassMetadataNotFoundEventArgs extends ManagerEventArgs
{ {
/** /**
* @var string * @var string
*/ */
private $className; private $className;
/**
* @var EntityManagerInterface
*/
private $em;
/** /**
* @var ClassMetadata|null * @var ClassMetadata|null
*/ */
@ -53,13 +50,14 @@ class OnClassMetadataNotFoundEventArgs extends EventArgs
/** /**
* Constructor. * Constructor.
* *
* @param string $className * @param string $className
* @param EntityManagerInterface $em * @param ObjectManager $objectManager
*/ */
public function __construct($className, EntityManagerInterface $em) public function __construct($className, ObjectManager $objectManager)
{ {
$this->className = (string) $className; $this->className = (string) $className;
$this->em = $em;
parent::__construct($objectManager);
} }
/** /**
@ -81,21 +79,11 @@ class OnClassMetadataNotFoundEventArgs extends EventArgs
/** /**
* Retrieve associated ClassMetadata. * Retrieve associated ClassMetadata.
* *
* @return \Doctrine\ORM\Mapping\ClassMetadataInfo * @return string
*/ */
public function getClassName() public function getClassName()
{ {
return $this->className; return $this->className;
} }
/**
* Retrieve associated EntityManager.
*
* @return \Doctrine\ORM\EntityManager
*/
public function getEntityManager()
{
return $this->em;
}
} }