diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index 597256ed7..bae46d34a 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -2311,6 +2311,7 @@ class ClassMetadataInfo implements ClassMetadata } $entityResult['entityClass'] = $this->fullyQualifiedClassName($entityResult['entityClass']); + $resultMapping['entities'][$key]['entityClass'] = ltrim($entityResult['entityClass'], '\\'); $resultMapping['entities'][$key]['isSelfClass'] = $entityResult['isSelfClass']; @@ -2496,6 +2497,7 @@ class ClassMetadataInfo implements ClassMetadata * * @param string $callback * @param string $eventName + * @throws \Doctrine\ORM\Mapping\MappingException */ public function addEntityListener($eventName, $class, $method) { @@ -2510,8 +2512,8 @@ class ClassMetadataInfo implements ClassMetadata } $this->entityListeners[$eventName][] = array( - 'class' => $class, - 'method' => $method + 'class' => $class, + 'method' => $method ); } diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index b069364ab..3ddf70c86 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -436,7 +436,7 @@ class AnnotationDriver extends AbstractAnnotationDriver } } - // evaluate as lifecycle callback if the listener class is not given. + // Evaluate as lifecycle callback if the listener class is not given. if(empty($entityListenersAnnot->value)) { /* @var $method \Doctrine\ORM\Mapping\LifecycleCallback */ foreach ($entityListenersAnnot->callbacks as $callback) { diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index 22bdf1608..95bb49e5c 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -567,8 +567,8 @@ class XmlDriver extends FileDriver $eventName = $prefix . ucfirst($suffix); $methodName = (string) $callbackElement['method']; - $listeners[] = array($eventName, $methodName); + $listeners[] = array($eventName, $methodName); } if (isset($listenerElement['class'])) { @@ -581,7 +581,7 @@ class XmlDriver extends FileDriver continue; } - // evaluate as lifecycle callback if the listener class is not given. + // Evaluate as lifecycle callback if the listener class is not given. foreach ($listeners as $item) { $metadata->addLifecycleCallback($item[1], $item[0]); } diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php index dc9fc3829..a4154871e 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -599,7 +599,7 @@ class YamlDriver extends FileDriver continue; } - // evaluate as lifecycle callback if the listener class is not given. + // Evaluate as lifecycle callback if the listener class is not given. foreach ($listeners as $item){ $metadata->addLifecycleCallback($item[1], $item[0]); } diff --git a/lib/Doctrine/ORM/Mapping/MappingException.php b/lib/Doctrine/ORM/Mapping/MappingException.php index a2688a177..61ecb4d11 100644 --- a/lib/Doctrine/ORM/Mapping/MappingException.php +++ b/lib/Doctrine/ORM/Mapping/MappingException.php @@ -692,10 +692,7 @@ class MappingException extends \Doctrine\ORM\ORMException */ public static function entityListenerClassNotFound($listenerName, $className) { - return new self(sprintf( - 'Entity Listener "%s" declared on "%s" not found.', - $listenerName, $className - )); + return new self(sprintf('Entity Listener "%s" declared on "%s" not found.', $listenerName, $className)); } /** @@ -707,10 +704,7 @@ class MappingException extends \Doctrine\ORM\ORMException */ public static function entityListenerMethodNotFound($listenerName, $methodName, $className) { - return new self(sprintf( - 'Entity Listener "%s" declared on "%s" has no method "%s".', - $listenerName, $className, $methodName - )); + return new self(sprintf('Entity Listener "%s" declared on "%s" has no method "%s".', $listenerName, $className, $methodName)); } /** diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 1c6cbeeb6..4969a31d6 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -977,7 +977,6 @@ class UnitOfWork implements PropertyChangedListener } foreach ($entities as $entity) { - if ($hasListeners || $hasEntityListeners | $hasLifecycleCallbacks) { $event = new LifecycleEventArgs($entity, $this->em); }