Created
December 28, 2016 15:46
-
-
Save akadlec/822195e33ff673182881821d47ea7213 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeService | |
{ | |
/** | |
* @var \Kdyby\Events\EventManager | |
*/ | |
private $eventManager; | |
protected function configure() | |
{ | |
//... | |
$this->eventManager->dispatchEvent('event.name.some', new \Kdyby\Events\EventArgsList([$this])); | |
} | |
} | |
final class SomeListener implements \Kdyby\Events\Subscriber | |
{ | |
public function getSubscribedEvents() : array | |
{ | |
return [ | |
'event.name.some' => 'onConfigure', | |
]; | |
} | |
public function onConfigure() | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment