Total Complexity | 7 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | final class OptimisticLockFailed extends \RuntimeException implements ORMException |
||
12 | { |
||
13 | /** @var object|null */ |
||
14 | private $entity; |
||
15 | |||
16 | /** |
||
17 | * @param string $msg |
||
18 | * @param object $entity |
||
19 | */ |
||
20 | 10 | public function __construct($msg, $entity) |
|
24 | 10 | } |
|
25 | |||
26 | /** |
||
27 | * Gets the entity that caused the exception. |
||
28 | * |
||
29 | * @return object|null |
||
30 | */ |
||
31 | 5 | public function getEntity() |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param object $entity |
||
38 | * @return OptimisticLockFailed |
||
39 | */ |
||
40 | 5 | public static function lockFailed($entity) |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * @param object $entity |
||
47 | * @param int $expectedLockVersion |
||
48 | * @param int $actualLockVersion |
||
49 | * @return OptimisticLockFailed |
||
50 | */ |
||
51 | 2 | public static function lockFailedVersionMismatch($entity, $expectedLockVersion, $actualLockVersion) |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * @param string $entityName |
||
61 | * |
||
62 | * @return OptimisticLockFailed |
||
63 | */ |
||
64 | 3 | public static function notVersioned($entityName) |
|
69 |