Understanding event types
Working with event types is better than overwriting a function with dependency injection. When analyzing a process, it is good to think about how you can solve your problem. It is better to execute extra code instead of rewriting the standard functions of Magento.
With events, it is possible to execute code when something happens, but before we can do that, we have to know which events are available, when they are dispatched, and which parameters are available.
Getting ready
In this recipe, we will debug the events that are fired in Magento. Ensure that you have access to the command line because we will debug using the Magento log files.
How to do it...
The following steps describe how we can create a list from the dispatched events in a Magento request:
Magento events are dispatched using the
dispatch()
method of theeventManager
interface. When we want to debug this function, we have to modify theMagento\Framework\Event\Manager
class. The first thing to do is to enable...