Newscoop\Entity\Repository\CommentRepository::getComment PHP Method

getComment() public method

Get single comment query
public getComment ( integer $id, $getDeleted = true ) : Query
$id integer
return Query
    public function getComment($id, $getDeleted = true)
    {
        $em = $this->getEntityManager();
        $queryBuilder = $em->getRepository('Newscoop\\Entity\\Comment')->createQueryBuilder('c')->andWhere('c.id = :id')->setParameter('id', $id);
        if (!$getDeleted) {
            $queryBuilder->andWhere('c.status != :status')->setParameter('status', Comment::STATUS_DELETED);
        }
        $query = $queryBuilder->getQuery();
        return $query;
    }