Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| InsertConflict | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| getStatusCode | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | namespace Apie\DoctrineEntityDatalayer\Exceptions; |
| 3 | |
| 4 | use Apie\Core\Exceptions\ApieException; |
| 5 | use Apie\Core\Exceptions\HttpStatusCodeException; |
| 6 | use Doctrine\DBAL\Exception\UniqueConstraintViolationException; |
| 7 | use Doctrine\ORM\Exception\EntityIdentityCollisionException; |
| 8 | |
| 9 | class InsertConflict extends ApieException implements HttpStatusCodeException |
| 10 | { |
| 11 | public function getStatusCode(): int |
| 12 | { |
| 13 | return 409; |
| 14 | } |
| 15 | |
| 16 | public function __construct(UniqueConstraintViolationException|EntityIdentityCollisionException $previous) |
| 17 | { |
| 18 | parent::__construct('Insertion conflict, unique constraint already exists', 0, $previous); |
| 19 | } |
| 20 | } |