Add query part to select nodes by level.

@param int    $level
@param string $alias optional, the alias to use

@return \BackBee\NestedNode\Repository\NestedNodeQueryBuilder
765927
public function andLevelEquals($level, $alias = null)
    {
        list($alias, $suffix) = $this->getAliasAndSuffix($alias);

        return $this->andWhere($alias.'._level = :level'.$suffix)
                        ->setParameter('level'.$suffix, $level);
    }
605798
protected function setLevel( int$level ):self
	{
		$level-= $this->level;

		if( $level<=0 ){
			$this->closeNodes(-$level);
		}elseif( $level==1 ){
			$this->level+= 1;
		}else{
			$this->throw('Indent error.');
		}

		return $this;
	}
69051
public function addAdminLevel(int $level, string $name, string $code = null): self
    {
        $this->adminLevels[] = new AdminLevel($level, $name, $code);

        return $this;
    }
1205915
public function getMediaFolderByLevels($levels)
    {
        $qb = $this->createQueryBuilder('mf')
                   ->andWhere('mf._level IN (:levels)')
                   ->setParameter('levels', $levels)
                   ->orderBy('mf._leftnode', 'asc');

        return $qb->getQuery()->getResult();
    }
1165167
public function selectColumn(string $column, ?string $alias = null)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->column($column, $alias);

        return $instance;
    }
838963
public static function setReportLevel(string $level): Matcha {
            if( ReportLevel::has($level) === false ) {
                throw new InvalidArgumentException(sprintf('The report level should be one of the following: %s, %s given', 
                    implode(', ', ReportLevel::availables()),
                    $level
                )); 
            }

            static::$reportLevel = $level;
            
            return new static;
        }
879641
public function subQuery(QueryBuilderHandler $queryBuilder, $alias = null)
    {
        $sql = '(' . $queryBuilder->getQuery()->getRawSql() . ')';
        if ($alias) {
            $sql = $sql . ' as ' . $alias;
        }

        return $queryBuilder->raw($sql);
    }
155048
public function alias($alias = null)
    {
        if (null === $alias) {
            $alias = $this->getTableAlias();
        }
        $this->oosql_table_alias = $alias;
        return $this;
    }
918905
public function addAlias($alias = null)
    {
        return (new AuthorizationBuilder(TransactionType::ALIAS, $this))
            ->withAlias(AliasAction::ADD, $alias);
    }
112008
public function addNoise($level) {
		$components = array();
		foreach($this->components as $component) {
			$components[] = $component + rand() * 2 * $level - $level;
		}
		$this->components = $components;
		return $this;
	}
423657
private function buildRootNode($node, $tree, $level)
    {
        $node->setLevel($level);
        $tree[$node->getId()] = $node;
    }
1214927
public function select($column, string $alias = null): self
    {
        if (\is_string($column)) {
            if (\strpos($column, ',')) {
                $this->select = \array_merge($this->select, \array_filter(\explode(',', $column)));
            } else {
                $this->select[$column] = $alias;
            }
        } elseif (\is_array($column)) {
            foreach ($column as $col => $ali) {
                if (\is_numeric($col)) {
                    $this->select[$ali] = null;
                } else {
                    $this->select[$col] = $ali;
                }
            }
        }

        return $this;
    }
759465
public function getSubDomain($level = '3rd')
    {
        if (isset($this->subDomains[ $level ])) {
            return $this->subDomains[ $level ];
        }

        return false;
    }
418471
public function setNextQueryIsolationLevel(string $level) : void
    {
        if (!\in_array($level, static::ISOLATION_LEVELS, true)) {
            throw new InvalidIsolationLevelException();
        }

        $this->nextQueryIsolationLevel = $level;
    }
1060247
protected function getQueryBuilder($alias = null, $indexBy = null)
    {
        $qb = $this->traitGetQueryBuilder($alias, $indexBy);

        $alias = $alias ?: $this->getAlias();

        return $qb
            ->addSelect('translation')
            ->leftJoin($alias . '.translations', 'translation');
    }
1156438
public function fields(array $fields, string $alias = null): Select
    {
        $alias = ($alias === null) ? '' : "{$alias}.";

        foreach ($fields as $field => $as) {
            if (is_numeric($field)) {
                $this->field($alias . $as);
            } else {
                $this->field($alias . $field, $as);
            }
        }

        return $this;
    }
846828
public function columnSelect(self $query, ?string $alias = null)
    {
        if ($alias) {
            $alias = $this->dialect()->quoteName($alias);
        }

        $this->addColumn($query, $alias);

        return $this;
    }