DatabaseLockBackend::ensureTableExists

protected DatabaseLockBackend::ensureTableExists() Check if the semaphore table exists and create it if not. File core/lib/Drupal/Core/Lock/DatabaseLockBackend.php, line 170 Class DatabaseLockBackend Defines the database lock backend. This is the default backend in Drupal. Namespace Drupal\Core\Lock Code protected function ensureTableExists() { try { $database_schema = $this->database->schema(); if (!$database_schema->tableExists(static::TABLE_NAME)) { $schema_

DatabaseLockBackend::catchException

protected DatabaseLockBackend::catchException(\Exception $e) Act on an exception when semaphore might be stale. If the table does not yet exist, that's fine, but if the table exists and yet the query failed, then the semaphore is stale and the exception needs to propagate. Parameters $e: The exception. Throws \Exception File core/lib/Drupal/Core/Lock/DatabaseLockBackend.php, line 200 Class DatabaseLockBackend Defines the database lock backend. This is the default backend in Drupal. Nam

DatabaseLockBackend::acquire

public DatabaseLockBackend::acquire($name, $timeout = 30.0) Acquires a lock. Parameters string $name: Lock name. Limit of name's length is 255 characters. float $timeout: (optional) Lock lifetime in seconds. Defaults to 30.0. Return value bool Overrides LockBackendInterface::acquire File core/lib/Drupal/Core/Lock/DatabaseLockBackend.php, line 44 Class DatabaseLockBackend Defines the database lock backend. This is the default backend in Drupal. Namespace Drupal\Core\Lock Code public f

DatabaseLockBackend::$database

The database connection. Type: \Drupal\Core\Database\Connection File core/lib/Drupal/Core/Lock/DatabaseLockBackend.php, line 26 Class DatabaseLockBackend Defines the database lock backend. This is the default backend in Drupal. Namespace Drupal\Core\Lock Code protected $database;

DatabaseLockBackend

Defines the database lock backend. This is the default backend in Drupal. Hierarchy class \Drupal\Core\Lock\LockBackendAbstract implements LockBackendInterfaceclass \Drupal\Core\Lock\DatabaseLockBackend Related topics Locking mechanisms Functions to coordinate long-running operations across requests. File core/lib/Drupal/Core/Lock/DatabaseLockBackend.php, line 14 Namespace Drupal\Core\Lock Members Name Modifiers Type Description DatabaseLockBackend::$database protected

DatabaseFileUsageBackend::__construct

public DatabaseFileUsageBackend::__construct(Connection $connection, $table = 'file_usage') Construct the DatabaseFileUsageBackend. Parameters \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'. File core/modules/file/src/FileUsage/DatabaseFileUsageBackend.php, line 36 Class DatabaseFileUsageBackend Defines the database file usag

DatabaseFileUsageBackend::listUsage

public DatabaseFileUsageBackend::listUsage(FileInterface $file) Determines where a file is used. Parameters \Drupal\file\FileInterface $file: A file entity. Return value array A nested array with usage data. The first level is keyed by module name, the second by object type and the third by the object id. The value of the third level contains the usage count. Overrides FileUsageInterface::listUsage File core/modules/file/src/FileUsage/DatabaseFileUsageBackend.php, line 98 Class DatabaseFi

DatabaseFileUsageBackend::delete

public DatabaseFileUsageBackend::delete(FileInterface $file, $module, $type = NULL, $id = NULL, $count = 1) Removes a record to indicate that a module is no longer using a file. Parameters \Drupal\file\FileInterface $file: A file entity. string $module: The name of the module using the file. string $type: (optional) The type of the object that contains the referenced file. May be omitted if all module references to a file are being deleted. Defaults to NULL. int $id: (optional) The unique, num

DatabaseFileUsageBackend::add

public DatabaseFileUsageBackend::add(FileInterface $file, $module, $type, $id, $count = 1) Records that a module is using a file. Examples: A module that associates files with nodes, so $type would be 'node' and $id would be the node's nid. Files for all revisions are stored within a single nid. The User module associates an image with a user, so $type would be 'user' and the $id would be the user's uid. Parameters \Drupal\file\FileInterface $file: A file entity. string $module: The name of

DatabaseFileUsageBackend::$tableName

The name of the SQL table used to store file usage information. Type: string File core/modules/file/src/FileUsage/DatabaseFileUsageBackend.php, line 25 Class DatabaseFileUsageBackend Defines the database file usage backend. This is the default Drupal backend. Namespace Drupal\file\FileUsage Code protected $tableName;