[2.0] Renaming LifecycleListener annotation to HasLifecycleCallbacks
This commit is contained in:
parent
c3081adb09
commit
b17ad38eed
3 changed files with 5 additions and 7 deletions
|
@ -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);
|
||||
|
|
|
@ -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 {}
|
||||
|
|
|
@ -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!';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue