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

Rebased and renamed PreLoadClassMetadata to OnClassMetadataNotFound

This commit is contained in:
Bart van den Burg 2012-11-23 12:15:30 +01:00 committed by Marco Pivetta
parent 437f812718
commit 3be43a1def
3 changed files with 5 additions and 5 deletions

View file

@ -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

View file

@ -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,

View file

@ -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']);