X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FDatabase%2FStatementPrefetch.php;h=fb7b0b4e0a03d2ae281ee64af5b66c57caf618fb;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=80252209e694ba9de0917f05a8c905fcf1f55ab8;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Database/StatementPrefetch.php b/web/core/lib/Drupal/Core/Database/StatementPrefetch.php index 80252209e..fb7b0b4e0 100644 --- a/web/core/lib/Drupal/Core/Database/StatementPrefetch.php +++ b/web/core/lib/Drupal/Core/Database/StatementPrefetch.php @@ -20,7 +20,7 @@ class StatementPrefetch implements \Iterator, StatementInterface { /** * Driver-specific options. Can be used by child classes. * - * @var Array + * @var array */ protected $driverOptions; @@ -41,14 +41,14 @@ class StatementPrefetch implements \Iterator, StatementInterface { /** * Main data store. * - * @var Array + * @var array */ protected $data = []; /** * The current row, retrieved in \PDO::FETCH_ASSOC format. * - * @var Array + * @var array */ protected $currentRow = NULL; @@ -62,7 +62,7 @@ class StatementPrefetch implements \Iterator, StatementInterface { /** * The list of column names in this result set. * - * @var Array + * @var array */ protected $columnNames = NULL; @@ -91,7 +91,7 @@ class StatementPrefetch implements \Iterator, StatementInterface { /** * Holds supplementary current fetch options (which will be used by the next fetch). * - * @var Array + * @var array */ protected $fetchOptions = [ 'class' => 'stdClass', @@ -110,7 +110,7 @@ class StatementPrefetch implements \Iterator, StatementInterface { /** * Holds supplementary default fetch options. * - * @var Array + * @var array */ protected $defaultFetchOptions = [ 'class' => 'stdClass', @@ -214,8 +214,8 @@ class StatementPrefetch implements \Iterator, StatementInterface { * * @param $query * The query. - * @param array $args - * An array of arguments. + * @param array|null $args + * An array of arguments. This can be NULL. * @return \PDOStatement * A PDOStatement object. */ @@ -497,8 +497,9 @@ class StatementPrefetch implements \Iterator, StatementInterface { * {@inheritdoc} */ public function fetchAllKeyed($key_index = 0, $value_index = 1) { - if (!isset($this->columnNames[$key_index]) || !isset($this->columnNames[$value_index])) + if (!isset($this->columnNames[$key_index]) || !isset($this->columnNames[$value_index])) { return []; + } $key = $this->columnNames[$key_index]; $value = $this->columnNames[$value_index];