function StatementBase::fetchAllAssoc
Overrides StatementInterface::fetchAllAssoc
File
-
core/
lib/ Drupal/ Core/ Database/ Statement/ StatementBase.php, line 326
Class
- StatementBase
- StatementInterface base implementation.
Namespace
Drupal\Core\Database\StatementCode
public function fetchAllAssoc($key, $fetch = NULL) {
if (is_int($fetch)) {
@trigger_error("Passing the \$fetch argument as an integer to fetchAllAssoc() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use a case of \\Drupal\\Core\\Database\\FetchAs enum instead. See https://www.drupal.org/node/3488338", E_USER_DEPRECATED);
$fetch = $this->pdoToFetchAs($fetch);
}
assert($fetch === NULL || $fetch instanceof FetchAs);
$result = $this->result
->fetchAllAssoc($key, $fetch ?? $this->fetchMode, $this->fetchOptions);
$this->markResultsetFetchingComplete();
return $result;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.