You are here

protected function TreeLockTrait::lockBackend in Entity Reference Hierarchy 3.x

Same name and namespace in other branches
  1. 8.2 src/Storage/TreeLockTrait.php \Drupal\entity_hierarchy\Storage\TreeLockTrait::lockBackend()

Gets lock backend.

Return value

\Drupal\Core\Lock\LockBackendInterface Lock backend.

File

src/Storage/TreeLockTrait.php, line 25

Class

TreeLockTrait
Defines a trait for locking tree operations.

Namespace

Drupal\entity_hierarchy\Storage

Code

protected function lockBackend() {
  if (!isset($this->lockBackend)) {
    $this->lockBackend = \Drupal::lock();
  }
  return $this->lockBackend;
}