/Drupal 8

interface StatementInterface

Represents a prepared statement.

Child implementations should either extend PDOStatement:

class Drupal\Core\Database\Driver\oracle\Statement extends PDOStatement implements Drupal\Core\Database\StatementInterface {}

or define their own class. If defining their own class, they will also have to implement either the Iterator or IteratorAggregate interface before Drupal\Core\Database\StatementInterface:

class Drupal\Core\Database\Driver\oracle\Statement implements Iterator, Drupal\Core\Database\StatementInterface {}


Related topics

Database abstraction layer
Allow the use of different database servers using the same code base.


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




Name Modifiers Type Description
StatementInterface::execute public function Executes a prepared statement
StatementInterface::fetch public function Fetches the next row from a result set.
StatementInterface::fetchAll function Returns an array containing all of the result set rows.
StatementInterface::fetchAllAssoc public function Returns the result set as an associative array keyed by the given field.
StatementInterface::fetchAllKeyed public function Returns the entire result set as a single associative array.
StatementInterface::fetchAssoc public function Fetches the next row and returns it as an associative array.
StatementInterface::fetchCol public function Returns an entire single column of a result set as an indexed array.
StatementInterface::fetchField public function Returns a single field from the next record of a result set.
StatementInterface::fetchObject public function Fetches the next row and returns it as an object.
StatementInterface::getQueryString public function Gets the query string of this statement.
StatementInterface::rowCount public function Returns the number of rows affected by the last SQL statement.
StatementInterface::setFetchMode public function Sets the default fetch mode for this statement.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.