function StatementInterface::setFetchMode
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Database/StatementInterface.php \Drupal\Core\Database\StatementInterface::setFetchMode()
- 10 core/lib/Drupal/Core/Database/StatementInterface.php \Drupal\Core\Database\StatementInterface::setFetchMode()
- 9 core/lib/Drupal/Core/Database/StatementInterface.php \Drupal\Core\Database\StatementInterface::setFetchMode()
- 8.9.x core/lib/Drupal/Core/Database/StatementInterface.php \Drupal\Core\Database\StatementInterface::setFetchMode()
Sets the default fetch mode for this statement.
Parameters
\Drupal\Core\Database\Statement\FetchAs $mode: One of the cases of the FetchAs enum.
string|int|null $a1: An option depending of the fetch mode specified by $mode:
- for FetchAs::Column, the index of the column to fetch;
- for FetchAs::ClassObject, the name of the class to create.
list<mixed> $a2: If $mode is FetchAs::ClassObject, the optional arguments to pass to the object constructor.
Return value
bool TRUE if successful, FALSE if not.
1 method overrides StatementInterface::setFetchMode()
- StatementBase::setFetchMode in core/
lib/ Drupal/ Core/ Database/ Statement/ StatementBase.php - Sets the default fetch mode for this statement.
File
-
core/
lib/ Drupal/ Core/ Database/ StatementInterface.php, line 81
Class
- StatementInterface
- Represents a prepared statement.
Namespace
Drupal\Core\DatabaseCode
public function setFetchMode($mode, $a1 = NULL, $a2 = []);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.