function PdoTrait::clientFetch

Fetches the next row from the PDO statement.

Parameters

\Drupal\Core\Database\FetchAs|null $mode: (Optional) one of the cases of the FetchAs enum. If not specified, defaults to what is specified by setFetchMode().

int|null $cursorOrientation: Not implemented in all database drivers, don't use.

int|null $cursorOffset: Not implemented in all database drivers, don't use.

Return value

array<scalar|null>|object|scalar|null|false A result, formatted according to $mode, or FALSE on failure.

File

core/lib/Drupal/Core/Database/Statement/PdoTrait.php, line 132

Class

PdoTrait
A trait for calling \PDOStatement methods.

Namespace

Drupal\Core\Database\Statement

Code

protected function clientFetch(?FetchAs $mode = NULL, ?int $cursorOrientation = NULL, ?int $cursorOffset = NULL) : array|object|int|float|string|bool|null {
    return match (func_num_args()) {    0 => $this->getClientStatement()
            ->fetch(),
        1 => $this->getClientStatement()
            ->fetch($this->fetchAsToPdo($mode)),
        2 => $this->getClientStatement()
            ->fetch($this->fetchAsToPdo($mode), $cursorOrientation),
        default => $this->getClientStatement()
            ->fetch($this->fetchAsToPdo($mode), $cursorOrientation, $cursorOffset),
    
    };
}

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