/** * @param Newscoop\Entity\User $user * @param Newscoop\Entity\Topic $topic */ public function __construct(User $user, Topic $topic) { $this->user = $user; $this->topic = $topic; $this->topic_id = $topic->getTopicId(); $this->topic_language = $topic->getLanguageId(); }
public function __toString() { $this->__load(); return parent::__toString(); }
/** * 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))); }