public function updateCommentsCount(PostInterface $post = null)
    {
        $commentTableName = $this->getObjectManager()->getClassMetadata($this->getClass())->table['name'];
        $postTableName = $this->getObjectManager()->getClassMetadata($this->postManager->getClass())->table['name'];

        $this->getConnection()->beginTransaction();
        $this->getConnection()->query($this->getCommentsCountResetQuery($postTableName));

        $this->getConnection()->query($this->getCommentsCountQuery($postTableName, $commentTableName));

        $this->getConnection()->commit();
    }
public function updateCommentsCount(PostInterface $post = null)
    {
        $commentTableName = $this->getObjectManager()->getClassMetadata($this->getClass())->table['name'];
        $postTableName = $this->getObjectManager()->getClassMetadata($this->postManager->getClass())->table['name'];

        $this->getConnection()->beginTransaction();
        $this->getConnection()->query($this->getCommentsCountResetQuery($postTableName));

        $this->getConnection()->query($this->getCommentsCountQuery($postTableName, $commentTableName));

        $this->getConnection()->commit();
    }
public function updateCommentsCount ( PostInterface $ post = null ) { $ commentTableName = $ this -> getObjectManager ( ) -> getClassMetadata ( $ this -> getClass ( ) ) -> table [ 'name' ] ; $ postTableName = $ this -> getObjectManager ( ) -> getClassMetadata ( $ this -> postManager -> getClass ( ) ) -> table [ 'name' ] ; $ this -> getConnection ( ) -> beginTransaction ( ) ; $ this -> getConnection ( ) -> query ( $ this -> getCommentsCountResetQuery ( $ postTableName ) ) ; $ this -> getConnection ( ) -> query ( $ this -> getCommentsCountQuery ( $ postTableName , $ commentTableName ) ) ; $ this -> getConnection ( ) -> commit ( ) ; }
Update the number of comment for a comment.

@param \Sonata\NewsBundle\Model\PostInterface|null $post
Update the number of comment for a comment .