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\StoreCode
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;
}