/** * Dispatch event * * @param Newscoop\Entity\User $user * @param Newscoop\Entity\Topic $topic */ private function notify(User $user, Topic $topic) { if (empty($this->dispatcher)) { return; } $this->dispatcher->notify('topic.follow', new \Newscoop\EventDispatcher\Events\GenericEvent($this, array('topic_name' => $topic->getName(), 'topic_id' => $topic->getTopicId(), 'user' => $user))); }
/** * Dispatch event. * * @param string $event * @param string $subject * @param array $params */ protected static function dispatchEvent($event, $subject, $params = array()) { if (empty(self::$eventDispatcher)) { return; } self::$eventDispatcher->notify($event, new GenericEvent($subject, $params)); }