0

I have a problem with my project :

Not called :

public function postRemove(LifecycleEventArgs $event)
{
    $test = 1;
    $test1 = 2;
}

Called :

public function preRemove(LifecycleEventArgs $event)
{
    $test = 1;
    $test1 = 2;
}

Strange that postRemove is not called. I confirm that the entity is deleted from database. Please give an idea.

GPiter
  • 779
  • 1
  • 11
  • 24
  • Place die() to make sure it's not being called. Also don't forget to register listener and add subscribed events function. – revengeance Aug 16 '18 at 08:35

1 Answers1

-1
public function getSubscribedEvents()
{
    return array(
        'postPersist',
        'postUpdate',
        'postRemove' // !!! 
    );
}

public function postUpdate(LifecycleEventArgs $args)
{
    dump('Update');
}

public function postPersist(LifecycleEventArgs $args)
{
    dump('Persist');
}


public function postRemove(LifecycleEventArgs $args)
{
    dump('Remove');
}
TsV
  • 629
  • 4
  • 7