Since doctrine 2.4 we can use Entity Listeners to perform operations before/after saving entity in database. How to use entity listeners in Symfony2 ? For example we need to log our entity on some condition.
The common task in web development is handling and monitoring exception with various tools. In this article I can show how to handle and log errors in Symfony2. For this task we will use our custom exception listener.
All we know that fat controllers is evil in MVC but where we can place additional logic ? One of the solutions in Symfony2 – events and event listeners provided by EventDispatcher Component.