function StatementWrapper::fetchObject

Same name in other branches
  1. 10 core/lib/Drupal/Core/Database/StatementWrapper.php \Drupal\Core\Database\StatementWrapper::fetchObject()

Overrides StatementInterface::fetchObject

File

core/lib/Drupal/Core/Database/StatementWrapper.php, line 222

Class

StatementWrapper
Implementation of StatementInterface encapsulating PDOStatement.

Namespace

Drupal\Core\Database

Code

public function fetchObject(string $class_name = NULL, array $constructor_arguments = NULL) {
    if ($class_name) {
        return $this->clientStatement
            ->fetchObject($class_name, $constructor_arguments);
    }
    return $this->clientStatement
        ->fetchObject();
}

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