function PdoTrait::clientFetchAll

2 calls to PdoTrait::clientFetchAll()
StatementPrefetchIterator::execute in core/lib/Drupal/Core/Database/StatementPrefetchIterator.php
Executes a prepared statement.
StatementWrapperIterator::fetchAll in core/lib/Drupal/Core/Database/StatementWrapperIterator.php
Returns an array containing all of the result set rows.

File

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

Class

PdoTrait
A trait for calling \PDOStatement methods.

Namespace

Drupal\Core\Database\Statement

Code

protected function clientFetchAll(?FetchAs $mode = NULL, int|string|null $columnOrClass = NULL, array|null $constructorArguments = NULL) : array {
    return match ($mode) {    FetchAs::Column => $this->getClientStatement()
            ->fetchAll(\PDO::FETCH_COLUMN, $columnOrClass ?? $this->fetchOptions['column']),
        FetchAs::ClassObject => $this->getClientStatement()
            ->fetchAll(\PDO::FETCH_CLASS, $columnOrClass ?? $this->fetchOptions['class'], $constructorArguments ?? $this->fetchOptions['constructor_args']),
        default => $this->getClientStatement()
            ->fetchAll($this->fetchAsToPdo($mode ?? $this->defaultFetchMode)),
    
    };
}

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