Newscoop\Entity\Repository\UserRepository::getEditorsCount PHP 메소드

getEditorsCount() 공개 메소드

Get editors count
public getEditorsCount ( integer $blogRole ) : integer
$blogRole integer
리턴 integer
    public function getEditorsCount($blogRole)
    {
        $query = $this->getEntityManager()->createQueryBuilder()->select('COUNT(u)')->from($this->getEntityName(), 'u')->leftJoin('u.groups', 'g', Expr\Join::WITH, 'g.id = ' . $blogRole)->where('u.is_admin = :admin')->andWhere('u.status = :status')->andWhere('u.author IS NOT NULL')->andWhere('g.id IS NULL')->getQuery();
        $query->setParameters(array('admin' => 1, 'status' => User::STATUS_ACTIVE));
        return $query->getSingleScalarResult();
    }