/** * Adds a child forum. * * @param Forum $child * * @return void */ public function addChild(Forum $child) { $this->visibleChildren = NULL; $this->children->attach($child); $child->setParent($this); $this->_resetCounters(); $this->_resetLastPost(); $this->_resetLastTopic(); }
/** * Subscribes this user to a subscribeable object, like a topic or a forum. * * @param SubscribeableInterface $object The object that is to be subscribed. This may either be a topic or a forum. * * @return void */ public function addSubscription(SubscribeableInterface $object) { if ($object instanceof Topic) { $this->topicSubscriptions->attach($object); } elseif ($object instanceof Forum) { $this->forumSubscriptions->attach($object); } }