/** * * @access public * @param \CCDNForum\ForumBundle\Entity\Topic $topic * @return \CCDNForum\ForumBundle\Manager\ManagerInterface */ public function incrementViewCounter(Topic $topic) { // set the new counters $topic->setCachedViewCount($topic->getCachedViewCount() + 1); $this->persist($topic)->flush(); return $this; }