4

我有一个事件订阅者,但是 preRemove 函数永远不会被调用,而是会调用其他事件。有什么我做错了吗?

class DocumentSubscriber implements EventSubscriber
{
    private $serviceContainer;

    public function getSubscribedEvents()
    {
        return array(
            'postUpdate',
            'preRemove',
        );
    }

    public function setServiceContainer($serviceContainer) {
        $this->serviceContainer = $serviceContainer;
    }

    public function preRemove(LifecycleEventArgs $args)
    {

    }

    public function postUpdate(LifecycleEventArgs $args)
    {

    }
}
4

0 回答 0