function StubConnection::schema

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Database/Stub/StubConnection.php \Drupal\Tests\Core\Database\Stub\StubConnection::schema()

Returns a DatabaseSchema object for manipulating the schema.

This method will lazy-load the appropriate schema library file.

@todo in drupal:11.0.0, make this method abstract since Schema is an abstract class.

Return value

\Drupal\Core\Database\Schema The database Schema object for this connection.

Overrides Connection::schema

File

core/tests/Drupal/Tests/Core/Database/Stub/StubConnection.php, line 172

Class

StubConnection
A stub of the abstract Connection class for testing purposes.

Namespace

Drupal\Tests\Core\Database\Stub

Code

public function schema() {
  if (empty($this->schema)) {
    $this->schema = new Schema();
  }
  return $this->schema;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.