function PdoResult::fetch

Overrides ResultBase::fetch

File

core/lib/Drupal/Core/Database/Statement/PdoResult.php, line 54

Class

PdoResult
Class for PDO-provided results of a data query language (DQL) statement.

Namespace

Drupal\Core\Database\Statement

Code

public function fetch(FetchAs $mode, array $fetchOptions) : array|object|int|float|string|bool|null {
    if (!empty($fetchOptions)) {
        $this->setFetchMode($mode, $fetchOptions);
    }
    if (isset($fetchOptions['cursor_orientation'])) {
        if (isset($fetchOptions['cursor_offset'])) {
            return $this->clientFetch($mode, $fetchOptions['cursor_orientation'], $fetchOptions['cursor_offset']);
        }
        return $this->clientFetch($mode, $fetchOptions['cursor_orientation']);
    }
    return $this->clientFetch($mode);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.