Do I need to instantiate the OrmServiceProvider, then register the listener, and then register that object on $app? e.g.
$ormServiceProvider = new \Dflydev\Provider\DoctrineOrm\DoctrineOrmServiceProvider();
$ormServiceProvider['orm.entity_listener_resolver']->register($app['user_ticket.entity_listener']);
$app->register($ormServiceProvider, [ /* other options */ ]);
In the UnitOfWork->commit function, it checks the event manager for preFlush listeners:
public function commit($entity = null)
{
// Raise preFlush
if ($this->evm->hasListeners(Events::preFlush)) {
$this->evm->dispatchEvent(Events::preFlush, new PreFlushEventArgs($this->em));
}
I threw a die statement in the conditional and it's just not being hit.
Hi, and thanks in advance for reading this and responding!
I would like to register an entity listener. Here is how I have tried to accomplish this:
My Listener looks like this:
And finally...
I have also tried:
and finally...
What am I doing wrong here?
Do I need to instantiate the OrmServiceProvider, then register the listener, and then register that object on $app? e.g.
In the UnitOfWork->commit function, it checks the event manager for preFlush listeners:
I threw a die statement in the conditional and it's just not being hit.
Any advice would be appreciated. Thanks!