1
0
mirror of synced 2024-12-14 07:06:04 +03:00

Added missing "new" keyword for event listener

This commit is contained in:
Tom Graham 2012-12-20 20:00:50 +00:00
parent 4b4126dfa6
commit e17fc6c474

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: