Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DatabaseBackend.php

function DatabaseBackend::__construct

Same name in this branch
  1. 11.1.x core/lib/Drupal/Core/Flood/DatabaseBackend.php \Drupal\Core\Flood\DatabaseBackend::__construct()

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.

\Drupal\Component\Serialization\ObjectAwareSerializationInterface|int|string|null $serializer: (optional) The serializer to use.

\Drupal\Component\Datetime\TimeInterface|int|string|null $time: The time service.

int $max_rows: (optional) The maximum number of rows that are allowed in this cache bin table.

File

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

Class

DatabaseBackend
Defines a default cache implementation.

Namespace

Drupal\Core\Cache

Code

public function __construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, $bin, ObjectAwareSerializationInterface $serializer, TimeInterface $time, $max_rows = NULL) {
    // All cache tables should be prefixed with 'cache_'.
    $bin = 'cache_' . $bin;
    $this->bin = $bin;
    $this->connection = $connection;
    $this->checksumProvider = $checksum_provider;
    $this->maxRows = $max_rows ?? static::DEFAULT_MAX_ROWS;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal