Call postRemove not working

727 views Asked by At

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.

1

There are 1 answers

0
TsV On
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');
}