You are here

public function StatementWrapper::__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/StatementWrapper.php, line 62

Class

StatementWrapper
Implementation of StatementInterface encapsulating PDOStatement.

Namespace

Drupal\Core\Database

Code

public function __get($name) {
  if ($name === 'queryString') {
    @trigger_error("StatementWrapper::\$queryString should not be accessed in drupal:9.1.0 and will error in drupal:10.0.0. Access the client-level statement object via ::getClientStatement(). See https://www.drupal.org/node/3177488", E_USER_DEPRECATED);
    return $this
      ->getClientStatement()->queryString;
  }
  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;
  }
}