【发布时间】:2016-10-11 15:30:12
【问题描述】:
生命周期回调在实体上注册:
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html#lifecycle-callbacks
为所有实体注册了事件监听器。但是,Doctrine 现在还具有所谓的“实体侦听器”(即事件侦听器,在 entity 级别注册):
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html#entity-listeners
不幸的是,文档没有说明两者之间的区别。什么时候用哪个?特别是:有没有异步调用的?
【问题讨论】:
标签: doctrine-orm