. */ namespace Doctrine\ORM\Event; use Doctrine\Common\EventArgs; use Doctrine\Common\Persistence\Mapping\ClassMetadata; use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; /** * Class that holds event arguments for a `onClassMetadataNotFound` event. * * This object is mutable by design, allowing callbacks having access to it to set the * found metadata in it, and therefore "cancelling" a `onClassMetadataNotFound` event * * @author Marco Pivetta * @since 2.5 */ class OnClassMetadataNotFoundEventArgs extends EventArgs { /** * @var string */ private $className; /** * @var EntityManagerInterface */ private $em; /** * @var ClassMetadata|null */ private $foundMetadata; /** * Constructor. * * @param string $className * @param EntityManagerInterface $em */ public function __construct($className, EntityManagerInterface $em) { $this->className = (string) $className; $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. * * @return \Doctrine\ORM\Mapping\ClassMetadataInfo */ public function getClassName() { return $this->className; } /** * Retrieve associated EntityManager. * * @return \Doctrine\ORM\EntityManager */ public function getEntityManager() { return $this->em; } }