Merge pull request #146 from noginn/patch-1
Added missing "new" keyword for event listener
This commit is contained in:
commit
a8340cc980
@ -354,7 +354,7 @@ EventManager that is passed to the EntityManager factory:
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
$eventManager = new EventManager();
|
$eventManager = new EventManager();
|
||||||
$eventManager->addEventListener(array(Events::preUpdate), MyEventListener());
|
$eventManager->addEventListener(array(Events::preUpdate), new MyEventListener());
|
||||||
$eventManager->addEventSubscriber(new MyEventSubscriber());
|
$eventManager->addEventSubscriber(new MyEventSubscriber());
|
||||||
|
|
||||||
$entityManager = EntityManager::create($dbOpts, $config, $eventManager);
|
$entityManager = EntityManager::create($dbOpts, $config, $eventManager);
|
||||||
@ -365,7 +365,7 @@ EntityManager was created:
|
|||||||
.. code-block:: php
|
.. code-block:: php
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$entityManager->getEventManager()->addEventListener(array(Events::preUpdate), MyEventListener());
|
$entityManager->getEventManager()->addEventListener(array(Events::preUpdate), new MyEventListener());
|
||||||
$entityManager->getEventManager()->addEventSubscriber(new MyEventSubscriber());
|
$entityManager->getEventManager()->addEventSubscriber(new MyEventSubscriber());
|
||||||
|
|
||||||
.. _reference-events-implementing-listeners:
|
.. _reference-events-implementing-listeners:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user