diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index ff02db1a5..d21ae9260 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -244,9 +244,8 @@ class AnnotationDriver implements Driver } } - // Evaluate LifecycleListener annotation - if (isset($classAnnotations['Doctrine\ORM\Mapping\LifecycleListener'])) { - $lifecycleListenerAnnot = $classAnnotations['Doctrine\ORM\Mapping\LifecycleListener']; + // Evaluate HasLifecycleCallbacks annotation + if (isset($classAnnotations['Doctrine\ORM\Mapping\HasLifecycleCallbacks'])) { foreach ($class->getMethods() as $method) { if ($method->isPublic()) { $annotations = $this->_reader->getMethodAnnotations($method); diff --git a/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php b/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php index c6c838bcb..ca44066f4 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php +++ b/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php @@ -119,7 +119,7 @@ final class SequenceGenerator extends Annotation { final class ChangeTrackingPolicy extends Annotation {} /* Annotations for lifecycle callbacks */ -final class LifecycleListener extends Annotation {} +final class HasLifecycleCallbacks extends Annotation {} final class PrePersist extends Annotation {} final class PostPersist extends Annotation {} final class PreUpdate extends Annotation {} diff --git a/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php b/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php index e0631b133..196ed4ba2 100644 --- a/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php @@ -43,7 +43,7 @@ class LifecycleCallbackTest extends \Doctrine\Tests\OrmFunctionalTestCase /** * @Entity - * @LifecycleListener + * @HasLifecycleCallbacks * @Table(name="lifecycle_callback_test_entity") */ class LifecycleCallbackTestEntity @@ -82,5 +82,4 @@ class LifecycleCallbackTestEntity public function doStuffOnPreUpdate() { $this->value = 'changed from preUpdate callback!'; } -} - +} \ No newline at end of file