简体   繁体   中英

Call postRemove not working

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM