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

Breadcrumb

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

function MongoDbStore::isDuplicateKeyException

2 calls to MongoDbStore::isDuplicateKeyException()
MongoDbStore::putOffExpiration in vendor/symfony/lock/Store/MongoDbStore.php
MongoDbStore::save in vendor/symfony/lock/Store/MongoDbStore.php

File

vendor/symfony/lock/Store/MongoDbStore.php, line 335

Class

MongoDbStore
MongoDbStore is a StoreInterface implementation using MongoDB as a storage engine. Support for MongoDB server >=2.2 due to use of TTL indexes.

Namespace

Symfony\Component\Lock\Store

Code

private function isDuplicateKeyException(BulkWriteException $e) : bool {
    $code = $e->getCode();
    $writeErrors = $e->getWriteResult()
        ->getWriteErrors();
    if (1 === \count($writeErrors)) {
        $code = $writeErrors[0]->getCode();
    }
    // Mongo error E11000 - DuplicateKey
    return 11000 === $code;
}

API Navigation

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