Newscoop\Entity\Repository\UserRepository::findEditors PHP Method

findEditors() public method

Get editors
public findEditors ( integer $blogRole, integer $limit, integer $offset ) : array
$blogRole integer
$limit integer
$offset integer
return array
    public function findEditors($blogRole, $limit, $offset)
    {
        $query = $this->createQueryBuilder('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')->orderBy('u.username', 'asc')->setFirstResult($offset)->setMaxResults($limit)->getQuery();
        $query->setParameters(array('admin' => 1, 'status' => User::STATUS_ACTIVE));
        return $query->getResult();
    }