eZ\Publish\Core\Persistence\Legacy\Content\Section\Gateway\DoctrineDatabase::countRoleAssignmentsUsingSection PHP Method

countRoleAssignmentsUsingSection() public method

Counts the number of role assignments using section with $id in their limitations.
    public function countRoleAssignmentsUsingSection($id)
    {
        $query = $this->dbHandler->createSelectQuery();
        $query->select($query->expr->count($this->dbHandler->quoteColumn('id', 'ezuser_role')))->from($this->dbHandler->quoteTable('ezuser_role'))->where($query->expr->lAnd($query->expr->eq($this->dbHandler->quoteColumn('limit_identifier', 'ezuser_role'), $query->bindValue('Section', null, \PDO::PARAM_STR)), $query->expr->eq($this->dbHandler->quoteColumn('limit_value', 'ezuser_role'), $query->bindValue($id, null, \PDO::PARAM_INT))));
        $statement = $query->prepare();
        $statement->execute();
        return (int) $statement->fetchColumn();
    }