Skip to content

Commit

Permalink
Added LifecycleEventsDispatcher::getDispatcher() that returns Sf's di…
Browse files Browse the repository at this point in the history
…spatcher, thus allowing to add/remove listeners
  • Loading branch information
jean-gui committed Nov 4, 2020
1 parent ff5cf46 commit 5488927
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Services/LifecycleEventsDispatcher.php
Expand Up @@ -6,6 +6,7 @@
use Doctrine\Persistence\Event\PreUpdateEventArgs;
use Doctrine\Common\Util\ClassUtils;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use W3C\LifecycleEventsBundle\Annotation\Change;
use W3C\LifecycleEventsBundle\Annotation\Create;
use W3C\LifecycleEventsBundle\Annotation\Delete;
Expand Down Expand Up @@ -84,6 +85,11 @@ public function __construct(EventDispatcherInterface $dispatcher, $autoDispatch)
$this->autoDispatch = $autoDispatch;
}

public function getDispatcher(): EventDispatcherInterface
{
return $this->dispatcher;
}

/**
* Dispatch all types of events to their listeners
*/
Expand Down

0 comments on commit 5488927

Please sign in to comment.