public function updateForumActivityStats(ForumInterface $forum, TopicInterface $topic, PostInterface $post) { $forum->setLastIndexed(new \DateTime()); $forum->setLastTopic($topic); $topics = $this->topicManager->getTopicCountByForum($forum); $forum->setTopicCount($topics); $this->update($forum); }
/** * (non-PHPDoc) * @see \Rhapsody\SocialBundle\Repository\TopicRepositoryInterface::findOneById() */ public function findOneByForumAndId(ForumInterface $forum, $id) { $qb = $this->createQueryBuilder()->field('_id')->equals(new \MongoId($id))->field('socialContext.$id')->equals(new \MongoId($forum->getId())); $query = $qb->getQuery(); return $query->getSingleResult(); }
/** * Returns the uniform resource location (URL) of the topic. * * @param ForumInterface $forum the forum. * @param TopicInterface $topic the topic. * @return the uniform resource location (URL) of the topic. */ protected function getTopicUrl(ForumInterface $forum, TopicInterface $topic) { $route = 'rhapsody_forum_topic_view'; $url = $this->router->generate($route, array('forum' => $forum->getId(), 'topic' => $topic->getId()), UrlGeneratorInterface::ABSOLUTE_URL); return $url; }