protected function createTopic($board, $title) { $topic = new Topic(); $topic->setBoard($board); $topic->setTitle($title); $topic->setCachedViewCount(0); $topic->setCachedReplyCount(0); $topic->setSticky(false); $topic->setClosed(false); $topic->setDeleted(false); return $topic; }
/** * * @access public * @param \CCDNForum\ForumBundle\Entity\Topic $topic * @return \CCDNForum\ForumBundle\Manager\ManagerInterface */ public function reopen(Topic $topic) { $topic->setClosed(false); $topic->setClosedBy(null); $topic->setClosedDate(null); if ($topic->isDeleted()) { $topic->setDeleted(false); $topic->setDeletedBy(null); $topic->setDeletedDate(null); } $this->persist($topic)->flush(); return $this; }