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

OnClassMetadataNotFoundEventArgs should support setting the actually resolved ClassMetadata as a mutable event result vector

This commit is contained in:
Marco Pivetta 2014-11-11 15:50:55 +01:00
parent efd4500e6b
commit f5eb20b63d

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\Mapping\ClassMetadata;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
/** /**
* Class that holds event arguments for a loadMetadata event. * Class that holds event arguments for a loadMetadata event.
@ -31,27 +33,48 @@ use Doctrine\ORM\EntityManager;
class OnClassMetadataNotFoundEventArgs extends EventArgs class OnClassMetadataNotFoundEventArgs extends EventArgs
{ {
/** /**
* @var \Doctrine\ORM\Mapping\ClassMetadata * @var string
*/ */
private $className; private $className;
/** /**
* @var \Doctrine\ORM\EntityManager * @var EntityManagerInterface
*/ */
private $em; private $em;
/**
* @var ClassMetadata|null
*/
private $foundMetadata;
/** /**
* Constructor. * Constructor.
* *
* @param \Doctrine\ORM\Mapping\ClassMetadataInfo $classMetadata * @param string $className
* @param \Doctrine\ORM\EntityManager $em * @param EntityManagerInterface $em
*/ */
public function __construct($className, EntityManager $em) public function __construct($className, EntityManagerInterface $em)
{ {
$this->className = $className; $this->className = (string) $className;
$this->em = $em; $this->em = $em;
} }
/**
* @param ClassMetadata|null $classMetadata
*/
public function setFoundMetadata(ClassMetadata $classMetadata = null)
{
$this->foundMetadata = $classMetadata;
}
/**
* @return ClassMetadata|null
*/
public function getFoundMetadata()
{
return $this->foundMetadata;
}
/** /**
* Retrieve associated ClassMetadata. * Retrieve associated ClassMetadata.
* *