1
0
mirror of synced 2025-01-19 06:51:40 +03:00

Merge pull request #146 from noginn/patch-1

Added missing "new" keyword for event listener
This commit is contained in:
Guilherme Blanco 2012-12-21 03:46:51 -08:00
commit a8340cc980

View File

@ -354,7 +354,7 @@ EventManager that is passed to the EntityManager factory:
<?php
$eventManager = new EventManager();
$eventManager->addEventListener(array(Events::preUpdate), MyEventListener());
$eventManager->addEventListener(array(Events::preUpdate), new MyEventListener());
$eventManager->addEventSubscriber(new MyEventSubscriber());
$entityManager = EntityManager::create($dbOpts, $config, $eventManager);
@ -365,7 +365,7 @@ EntityManager was created:
.. code-block:: php
<?php
$entityManager->getEventManager()->addEventListener(array(Events::preUpdate), MyEventListener());
$entityManager->getEventManager()->addEventListener(array(Events::preUpdate), new MyEventListener());
$entityManager->getEventManager()->addEventSubscriber(new MyEventSubscriber());
.. _reference-events-implementing-listeners: