Newscoop\Entity\Repository\RelatedArticleRepository::getAllArticles PHP Method

getAllArticles() public method

Get all related articles for related articles container, optionaly get only count of articles
public getAllArticles ( RelatedArticles $relatedArticles, boolean $countOnly = false ) : Doctrine\ORM\Query
$relatedArticles Newscoop\Entity\RelatedArticles
$countOnly boolean
return Doctrine\ORM\Query
    public function getAllArticles($relatedArticles, $countOnly = false)
    {
        $qb = $this->createQueryBuilder('r')->where('r.articleListId = :articleListId')->setParameters(array('articleListId' => $relatedArticles->getId()))->orderBy('r.order', 'ASC');
        if ($countOnly) {
            return $qb->select('COUNT(r.id)')->getQuery();
        }
        $query = $qb->getQuery();
        return $query;
    }
RelatedArticleRepository