You are here

public function DatabaseFileUsageBackend::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/file/src/FileUsage/DatabaseFileUsageBackend.php \Drupal\file\FileUsage\DatabaseFileUsageBackend::__construct()

Construct the DatabaseFileUsageBackend.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

\Drupal\Core\Database\Connection $connection: The database connection which will be used to store the file usage information.

string $table: (optional) The table to store file usage info. Defaults to 'file_usage'.

Overrides FileUsageBase::__construct

File

core/modules/file/src/FileUsage/DatabaseFileUsageBackend.php, line 39

Class

DatabaseFileUsageBackend
Defines the database file usage backend. This is the default Drupal backend.

Namespace

Drupal\file\FileUsage

Code

public function __construct(ConfigFactoryInterface $config_factory, Connection $connection, $table = 'file_usage') {
  parent::__construct($config_factory);
  $this->connection = $connection;
  $this->tableName = $table;
}