src/PHPDish/Bundle/PostBundle/Twig/PostExtension.php
public function getComments($criteria, array $orderBy = [], ?int $limit = null)
    {
        if ($criteria instanceof Criteria) {
            return $this->commentManager->findComments($criteria);
        } else {
            return $this->commentManager->getCommentRepository()->findBy($criteria, $orderBy, $limit);
        }
    }
public function getComments($criteria, array $orderBy = [], ?int $limit = null)
    {
        if ($criteria instanceof Criteria) {
            return $this->commentManager->findComments($criteria);
        } else {
            return $this->commentManager->getCommentRepository()->findBy($criteria, $orderBy, $limit);
        }
    }
查找评论

@param array|Criteria $criteria
@param array $orderBy
@param int|null $limit
@return CommentInterface[]|Collection