diff --git a/en/core-libraries/events.rst b/en/core-libraries/events.rst index 56bb87d68d..25baaa6329 100644 --- a/en/core-libraries/events.rst +++ b/en/core-libraries/events.rst @@ -182,6 +182,7 @@ necessary. Our ``UserStatistics`` listener might start out like:: } } + // In a controller or somewhere else where $this->Order is accessible // Attach the UserStatistic object to the Order's event manager $statistics = new UserStatistic(); $this->Order->getEventManager()->attach($statistics);