简体   繁体   中英

Register lifecycle callback during compilation phase

I'm trying to register an event callback specific to a single type of entity only, for that reason I do not want to use the generic event listeners which hook into every entity events.

I would like to be able to create a lifecycle callback during the compilation process of symfony (I don't want to have the lifecycle hardcoded in the yml/xml or php annotation).

To answer my own question, I accidentally stumbled upon this:

http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/events.html#entity-listeners

It's not exactly what I was looking for, but it helps me to resolve the same issue so I'm rather happy.

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