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

Breadcrumb

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

function StatementInterface::setFetchMode

Sets the default fetch mode for this statement.

See http://php.net/manual/pdo.constants.php for the definition of the constants used.

Parameters

$mode: One of the \PDO::FETCH_* constants.

$a1: An option depending of the fetch mode specified by $mode:

  • for \PDO::FETCH_COLUMN, the index of the column to fetch
  • for \PDO::FETCH_CLASS, the name of the class to create
  • for \PDO::FETCH_INTO, the object to add the data to

$a2: If $mode is \PDO::FETCH_CLASS, the optional arguments to pass to the constructor.

2 methods override StatementInterface::setFetchMode()
StatementPrefetchIterator::setFetchMode in core/lib/Drupal/Core/Database/StatementPrefetchIterator.php
Sets the default fetch mode for this statement.
StatementWrapperIterator::setFetchMode in core/lib/Drupal/Core/Database/StatementWrapperIterator.php
Sets the default fetch mode for this statement.

File

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

Class

StatementInterface
Represents a prepared statement.

Namespace

Drupal\Core\Database

Code

public function setFetchMode($mode, $a1 = NULL, $a2 = []);

API Navigation

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