src/PHPDish/Bundle/ForumBundle/Service/TopicManager.php
public function saveTopic(TopicInterface $topic)
    {
        $parsedBody = $this->bodyProcessor->process($topic->getOriginalBody());
        $topic->setUpdatedAt(Carbon::now())
            ->setBody($parsedBody);

        //给节点增加话题数
        if (!$topic->getId()) {
            foreach ($topic->getThreads() as $thread) {
                $thread->addPostCount(1);
            }
        }
        $this->entityManager->persist($topic);
        $this->entityManager->flush();

        return true;
    }
public function saveTopic(TopicInterface $topic)
    {
        $parsedBody = $this->bodyProcessor->process($topic->getOriginalBody());
        $topic->setUpdatedAt(Carbon::now())
            ->setBody($parsedBody);

        //给节点增加话题数
        if (!$topic->getId()) {
            foreach ($topic->getThreads() as $thread) {
                $thread->addPostCount(1);
            }
        }
        $this->entityManager->persist($topic);
        $this->entityManager->flush();

        return true;
    }
{@inheritdoc}