src/Db/Command.php
public function fetchResults($results, $fetchMethod = self::FETCH_ALL, $fetchMode = self::FETCH_MODE_ASSOC) {
        $data = [];
        if ($fetchMethod === '') {
            return new DataReader($this, $results);
        }
        if (empty($results)) {
            return in_array($fetchMethod, [static::FETCH_ALL, static::FETCH_COLUMN]) ? [] : reject(null);
        } elseif (in_array($fetchMethod, [static::FETCH_FIELD, static::FETCH_ROW])) {
            $firstRow = reset($results);
            return $this->fetchResultsRow($firstRow, $fetchMethod, $fetchMode);
        }
        foreach ($results as $row) {
            $dataRow = $this->fetchResultsRow($row, $fetchMethod, $fetchMode);
            if ($dataRow === null) {
                continue;
            }
            $data[] = $dataRow;
        }
        return $data;
    }
public function fetchResults($results, $fetchMethod = self::FETCH_ALL, $fetchMode = self::FETCH_MODE_ASSOC) {
        $data = [];
        if ($fetchMethod === '') {
            return new DataReader($this, $results);
        }
        if (empty($results)) {
            return in_array($fetchMethod, [static::FETCH_ALL, static::FETCH_COLUMN]) ? [] : reject(null);
        } elseif (in_array($fetchMethod, [static::FETCH_FIELD, static::FETCH_ROW])) {
            $firstRow = reset($results);
            return $this->fetchResultsRow($firstRow, $fetchMethod, $fetchMode);
        }
        foreach ($results as $row) {
            $dataRow = $this->fetchResultsRow($row, $fetchMethod, $fetchMode);
            if ($dataRow === null) {
                continue;
            }
            $data[] = $dataRow;
        }
        return $data;
    }
Fetch results
@param array  $results
@param string $fetchMethod
@param string $fetchMode
@return array|null|object|ExtendedPromiseInterface
@internal