Mercurial > hg > isophonics-drupal-site
view core/lib/Drupal/Core/Database/StatementEmpty.php @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line source
<?php namespace Drupal\Core\Database; /** * Empty implementation of a database statement. * * This class satisfies the requirements of being a database statement/result * object, but does not actually contain data. It is useful when developers * need to safely return an "empty" result set without connecting to an actual * database. Calling code can then treat it the same as if it were an actual * result set that happens to contain no records. * * @see \Drupal\search\SearchQuery */ class StatementEmpty implements \Iterator, StatementInterface { /** * Is rowCount() execution allowed. * * @var bool */ public $allowRowCount = FALSE; /** * {@inheritdoc} */ public function execute($args = [], $options = []) { return FALSE; } /** * {@inheritdoc} */ public function getQueryString() { return ''; } /** * {@inheritdoc} */ public function rowCount() { if ($this->allowRowCount) { return 0; } throw new RowCountException(); } /** * {@inheritdoc} */ public function setFetchMode($mode, $a1 = NULL, $a2 = []) { return; } /** * {@inheritdoc} */ public function fetch($mode = NULL, $cursor_orientation = NULL, $cursor_offset = NULL) { return NULL; } /** * {@inheritdoc} */ public function fetchField($index = 0) { return NULL; } /** * {@inheritdoc} */ public function fetchObject() { return NULL; } /** * {@inheritdoc} */ public function fetchAssoc() { return NULL; } /** * {@inheritdoc} */ public function fetchAll($mode = NULL, $column_index = NULL, $constructor_arguments = NULL) { return []; } /** * {@inheritdoc} */ public function fetchCol($index = 0) { return []; } /** * {@inheritdoc} */ public function fetchAllKeyed($key_index = 0, $value_index = 1) { return []; } /** * {@inheritdoc} */ public function fetchAllAssoc($key, $fetch = NULL) { return []; } /** * {@inheritdoc} */ public function current() { return NULL; } /** * {@inheritdoc} */ public function key() { return NULL; } /** * {@inheritdoc} */ public function rewind() { // Nothing to do: our DatabaseStatement can't be rewound. } /** * {@inheritdoc} */ public function next() { // Do nothing, since this is an always-empty implementation. } /** * {@inheritdoc} */ public function valid() { return FALSE; } }