public function DatabaseBackend::__construct

Same name in this branch

Constructs a DatabaseBackend object.

Parameters

\Drupal\Core\Database\Connection $connection: The database connection.

string $bin: The cache bin for which the object is created.

File

drupal/core/lib/Drupal/Core/Cache/DatabaseBackend.php, line 43
Definition of Drupal\Core\Cache\DatabaseBackend.

Class

DatabaseBackend
Defines a default cache implementation.

Namespace

Drupal\Core\Cache

Code

public function __construct(Connection $connection, $bin) {

  // All cache tables should be prefixed with 'cache_', except for the
  // default 'cache' bin.
  if ($bin != 'cache') {
    $bin = 'cache_' . $bin;
  }
  $this->bin = $bin;
  $this->connection = $connection;
}