Ojs\JournalBundle\Entity\ArticleRepository::getCountBy PHP Метод

getCountBy() публичный Метод

Return article count by condition
public getCountBy ( $field, $value ) : mixed
$field
$value
Результат mixed
    public function getCountBy($field, $value)
    {
        $qb = $this->createQueryBuilder("a");
        $qb->select("count(a.id)")->where($qb->expr()->eq("a.{$field}", ':value'))->setParameter("value", $value);
        return $qb->getQuery()->getSingleScalarResult();
    }