Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. StatementInterface.php

function StatementInterface::fetchObject

Fetches the next row and returns it as an object.

The object will be of the class specified by StatementInterface::setFetchMode() or stdClass if not specified.

Parameters

string|null $class_name: Name of the created class.

array $constructor_arguments: Elements of this array are passed to the constructor.

Return value

mixed The object of specified class or \stdClass if not specified. Returns FALSE or NULL if there is no next row.

2 methods override StatementInterface::fetchObject()
StatementPrefetchIterator::fetchObject in core/lib/Drupal/Core/Database/StatementPrefetchIterator.php
Fetches the next row and returns it as an object.
StatementWrapperIterator::fetchObject in core/lib/Drupal/Core/Database/StatementWrapperIterator.php
Fetches the next row and returns it as an object.

File

core/lib/Drupal/Core/Database/StatementInterface.php, line 129

Class

StatementInterface
Represents a prepared statement.

Namespace

Drupal\Core\Database

Code

public function fetchObject(?string $class_name = NULL, array $constructor_arguments = []);

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal