Drupal 8  8.0.2
DatabaseLockBackend Class Reference
Inheritance diagram for DatabaseLockBackend:

Public Member Functions

 __construct (Connection $database)
 
 acquire ($name, $timeout=30.0)
 
 lockMayBeAvailable ($name)
 
 release ($name)
 
 releaseAll ($lock_id=NULL)
 
- Public Member Functions inherited from LockBackendAbstract
 wait ($name, $delay=30)
 
 getLockId ()
 

Protected Attributes

 $database
 
- Protected Attributes inherited from LockBackendAbstract
 $lockId
 
 $locks = array()
 

Detailed Description

Defines the database lock backend. This is the default backend in Drupal.

Constructor & Destructor Documentation

__construct ( Connection  $database)

Constructs a new DatabaseLockBackend.

Parameters
\Drupal\Core\Database\Connection$databaseThe database connection.

References Drupal\database(), and drupal_register_shutdown_function().

Here is the call graph for this function:

Member Function Documentation

acquire (   $name,
  $timeout = 30.0 
)

{Acquires a lock.

Parameters
string$nameLock name. Limit of name's length is 255 characters.
float$timeout= 30.0 (optional) Lock lifetime in seconds.
Returns
bool
}

Implements LockBackendInterface.

References Drupal\database(), LockBackendAbstract\getLockId(), and DatabaseLockBackend\lockMayBeAvailable().

Here is the call graph for this function:

lockMayBeAvailable (   $name)

{Checks if a lock is available for acquiring.

Parameters
string$nameLock to acquire.
Returns
bool
}

Implements LockBackendInterface.

References Drupal\database().

Referenced by DatabaseLockBackend\acquire().

Here is the call graph for this function:

Here is the caller graph for this function:

release (   $name)

{Releases the given lock.

Parameters
string$name
}

Implements LockBackendInterface.

References Drupal\database(), and LockBackendAbstract\getLockId().

Here is the call graph for this function:

releaseAll (   $lock_id = NULL)

{Releases all locks for the given lock token identifier.

Parameters
string$lockId(optional) If none given, remove all locks from the current page. Defaults to NULL.
}

Implements LockBackendInterface.

References Drupal\database(), and LockBackendAbstract\getLockId().

Here is the call graph for this function:


The documentation for this class was generated from the following file: