public function DatabaseBackend::__construct

public DatabaseBackend::__construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, $bin)

Constructs a DatabaseBackend object.

Parameters

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

\Drupal\Core\Cache\CacheTagsChecksumInterface $checksum_provider: The cache tags checksum provider.

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

File

core/lib/Drupal/Core/Cache/DatabaseBackend.php, line 49

Class

DatabaseBackend
Defines a default cache implementation.

Namespace

Drupal\Core\Cache

Code

public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, $bin) {
  // All cache tables should be prefixed with 'cache_'.
  $bin = 'cache_' . $bin;

  $this->bin = $bin;
  $this->connection = $connection;
  $this->checksumProvider = $checksum_provider;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Cache!DatabaseBackend.php/function/DatabaseBackend::__construct/8.1.x