Closed
Description
As mentioned at the end of Creating the Listener Class paragraph from event listeners and subscribers doctrine cookbook, entity listeners are introduced in Doctrine 2.4.
An entity listener is a lifecycle listener class used for a specific entity. Entity listeners can be defined as services and the great thing is that they can have container services/parameters injected. Shouldn't this be documented? For example:
services:
user_listener:
class: \UserListener
arguments:
- "%some_param%"
tags:
- { name: doctrine.orm.entity_listener }
- { name: doctrine.orm.entity_listener, entity_manager: custom }
Entity listeners are barely mentioned here. This was ticket was opened as a suggestion.