Rebased and renamed PreLoadClassMetadata to OnClassMetadataNotFound
This commit is contained in:
parent
437f812718
commit
3be43a1def
3 changed files with 5 additions and 5 deletions
|
@ -28,7 +28,7 @@ use Doctrine\ORM\EntityManager;
|
||||||
* @author Jonathan H. Wage <jonwage@gmail.com>
|
* @author Jonathan H. Wage <jonwage@gmail.com>
|
||||||
* @since 2.3
|
* @since 2.3
|
||||||
*/
|
*/
|
||||||
class PreLoadClassMetadataEventArgs extends EventArgs
|
class OnClassMetadataNotFoundEventArgs extends EventArgs
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var \Doctrine\ORM\Mapping\ClassMetadata
|
* @var \Doctrine\ORM\Mapping\ClassMetadata
|
|
@ -125,7 +125,7 @@ final class Events
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const preLoadClassMetadata = 'preLoadClassMetadata';
|
const onClassMetadataNotFound = 'onClassMetadataNotFound';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The preFlush event occurs when the EntityManager#flush() operation is invoked,
|
* The preFlush event occurs when the EntityManager#flush() operation is invoked,
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
namespace Doctrine\ORM\Tools;
|
namespace Doctrine\ORM\Tools;
|
||||||
|
|
||||||
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
|
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
|
||||||
use Doctrine\ORM\Event\PreLoadClassMetadataEventArgs;
|
use Doctrine\ORM\Event\OnClassMetadataNotFoundEventArgs;
|
||||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||||
use Doctrine\Common\EventSubscriber;
|
use Doctrine\Common\EventSubscriber;
|
||||||
use Doctrine\ORM\Events;
|
use Doctrine\ORM\Events;
|
||||||
|
@ -45,7 +45,7 @@ class ResolveTargetEntityListener implements EventSubscriber
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
Events::loadClassMetadata,
|
Events::loadClassMetadata,
|
||||||
Events::preLoadClassMetadata
|
Events::onClassMetadataNotFound
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -63,7 +63,7 @@ class ResolveTargetEntityListener implements EventSubscriber
|
||||||
$this->resolveTargetEntities[ltrim($originalEntity, "\\")] = $mapping;
|
$this->resolveTargetEntities[ltrim($originalEntity, "\\")] = $mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function preLoadClassMetadata(PreLoadClassMetadataEventArgs $args)
|
public function onClassMetadataNotFound(OnClassMetadataNotFoundEventArgs $args)
|
||||||
{
|
{
|
||||||
if (array_key_exists($args->getClassName(), $this->resolveTargetEntities)) {
|
if (array_key_exists($args->getClassName(), $this->resolveTargetEntities)) {
|
||||||
$args->getEntityManager()->getClassMetadata($this->resolveTargetEntities[$args->getClassname()]['targetEntity']);
|
$args->getEntityManager()->getClassMetadata($this->resolveTargetEntities[$args->getClassname()]['targetEntity']);
|
||||||
|
|
Loading…
Add table
Reference in a new issue