You are here

public function StatementPrefetch::__get in Drupal 9

Implements the magic __get() method.

@todo Remove the method before Drupal 10.

See also

https://www.drupal.org/i/3210310

File

core/lib/Drupal/Core/Database/StatementPrefetch.php, line 157

Class

StatementPrefetch
An implementation of StatementInterface that prefetches all data.

Namespace

Drupal\Core\Database

Code

public function __get($name) {
  if ($name === 'dbh') {
    @trigger_error(__CLASS__ . '::$dbh should not be accessed in drupal:9.3.0 and will error in drupal:10.0.0. Use $this->connection instead. See https://www.drupal.org/node/3186368', E_USER_DEPRECATED);
    return $this->connection;
  }
  if ($name === 'allowRowCount') {
    @trigger_error(__CLASS__ . '::$allowRowCount should not be accessed in drupal:9.3.0 and will error in drupal:10.0.0. Use $this->rowCountEnabled instead. See https://www.drupal.org/node/3186368', E_USER_DEPRECATED);
    return $this->rowCountEnabled;
  }
}