class IntegrityConstraintViolationException

Same name in other branches
  1. 9 core/lib/Drupal/Core/Database/IntegrityConstraintViolationException.php \Drupal\Core\Database\IntegrityConstraintViolationException
  2. 8.9.x core/lib/Drupal/Core/Database/IntegrityConstraintViolationException.php \Drupal\Core\Database\IntegrityConstraintViolationException
  3. 11.x core/lib/Drupal/Core/Database/IntegrityConstraintViolationException.php \Drupal\Core\Database\IntegrityConstraintViolationException

Exception thrown if a query would violate an integrity constraint.

This exception is thrown e.g. when trying to insert a row that would violate a unique key constraint.

Hierarchy

Expanded class hierarchy of IntegrityConstraintViolationException

10 files declare their use of IntegrityConstraintViolationException
BatchBidSerialUpdateTest.php in core/modules/system/tests/src/Functional/Update/BatchBidSerialUpdateTest.php
DatabaseLockBackend.php in core/lib/Drupal/Core/Lock/DatabaseLockBackend.php
DriverSpecificSchemaTestBase.php in core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php
EntityDefinitionUpdateTest.php in core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
ExceptionHandler.php in core/modules/mysql/src/Driver/Database/mysql/ExceptionHandler.php

... See full list

File

core/lib/Drupal/Core/Database/IntegrityConstraintViolationException.php, line 11

Namespace

Drupal\Core\Database
View source
class IntegrityConstraintViolationException extends \RuntimeException implements DatabaseException {

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.