Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DoctrineDbalPostgreSqlStore.php

function DoctrineDbalPostgreSqlStore::delete

Overrides PersistingStoreInterface::delete

File

vendor/symfony/lock/Store/DoctrineDbalPostgreSqlStore.php, line 147

Class

DoctrineDbalPostgreSqlStore
DoctrineDbalPostgreSqlStore is a PersistingStoreInterface implementation using PostgreSql advisory locks with a Doctrine DBAL Connection.

Namespace

Symfony\Component\Lock\Store

Code

public function delete(Key $key) : void {
    // Prevent deleting locks own by an other key in the same connection
    if (!$this->exists($key)) {
        return;
    }
    $this->unlock($key);
    // Prevent deleting Readlocks own by current key AND an other key in the same connection
    $store = $this->getInternalStore();
    try {
        // If lock acquired = there is no other ReadLock
        $store->save($key);
        $this->unlockShared($key);
    } catch (LockConflictedException) {
        // an other key exists in this ReadLock
    }
    $store->delete($key);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal