OnClassMetadataNotFoundEventArgs
should support setting the actually resolved ClassMetadata
as a mutable event result vector
This commit is contained in:
parent
efd4500e6b
commit
f5eb20b63d
1 changed files with 29 additions and 6 deletions
|
@ -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.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue