preRemove永远不会被称为学说事件监听器

时间:2013-04-17 13:12:33

标签: php symfony doctrine symfony-2.1 event-listener

我有一个事件订阅者,但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)
    {

    }
}

0 个答案:

没有答案