class DatabaseBackendFactory implements CacheFactoryInterface (View source)

Properties

protected Connection $connection

The database connection.

protected CacheTagsChecksumInterface $checksumProvider

The cache tags checksum provider.

protected Settings $settings

The site settings.

Methods

__construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, Settings $settings = NULL)

Constructs the DatabaseBackendFactory object.

get(string $bin)

Gets DatabaseBackend for the specified cache bin.

int
getMaxRowsForBin(string $bin)

Gets the max rows for the specified cache bin.

Details

__construct(Connection $connection, CacheTagsChecksumInterface $checksum_provider, Settings $settings = NULL)

Constructs the DatabaseBackendFactory object.

Parameters

Connection $connection

Database connection

CacheTagsChecksumInterface $checksum_provider

The cache tags checksum provider.

Settings $settings

(optional) The site settings.

Exceptions

BadMethodCallException

CacheBackendInterface get(string $bin)

Gets DatabaseBackend for the specified cache bin.

Parameters

string $bin

The cache bin for which a cache backend object should be returned.

Return Value

CacheBackendInterface

The cache backend object associated with the specified bin.

protected int getMaxRowsForBin(string $bin)

Gets the max rows for the specified cache bin.

Parameters

string $bin

The cache bin for which the object is created.

Return Value

int

The maximum number of rows for the given bin. Defaults to DatabaseBackend::DEFAULT_MAX_ROWS.