我的项目有问题:
Not called :
public function postRemove(LifecycleEventArgs $event)
{
$test = 1;
$test1 = 2;
}
Called :
public function preRemove(LifecycleEventArgs $event)
{
$test = 1;
$test1 = 2;
}
奇怪的是没有调用postRemove。我确认该实体已从数据库中删除。请给个主意。
答案 0 :(得分:0)
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');
}