function PdoResult::setFetchMode

Overrides ResultBase::setFetchMode

1 call to PdoResult::setFetchMode()
PdoResult::fetch in core/lib/Drupal/Core/Database/Statement/PdoResult.php
Fetches the next row.

File

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

Class

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

Namespace

Drupal\Core\Database\Statement

Code

public function setFetchMode(FetchAs $mode, array $fetchOptions) : bool {
    return match ($mode) {    FetchAs::ClassObject => $this->clientSetFetchMode($mode, $fetchOptions['class'], $fetchOptions['constructor_args'] ?? NULL),
        FetchAs::Column => $this->clientSetFetchMode($mode, $fetchOptions['column']),
        default => $this->clientSetFetchMode($mode),
    
    };
}

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