Total Complexity | 3 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
9 | #[Package('core')] |
||
10 | class CustomEntityException extends HttpException |
||
11 | { |
||
12 | public const CUSTOM_FIELDS_AWARE_NO_LABEL_PROPERTY = 'NO_LABEL_PROPERTY'; |
||
13 | public const CUSTOM_FIELDS_AWARE_LABEL_PROPERTY_NOT_DEFINED = 'LABEL_PROPERTY_NOT_DEFINED'; |
||
14 | public const CUSTOM_FIELDS_AWARE_LABEL_PROPERTY_WRONG_TYPE = 'LABEL_PROPERTY_WRONG_TYPE'; |
||
15 | |||
16 | public static function noLabelProperty(): self |
||
17 | { |
||
18 | return new self(Response::HTTP_INTERNAL_SERVER_ERROR, self::CUSTOM_FIELDS_AWARE_NO_LABEL_PROPERTY, 'Entity must have a label property when it is custom field aware'); |
||
19 | } |
||
20 | |||
21 | public static function labelPropertyNotDefined(string $labelProperty): self |
||
22 | { |
||
23 | return new self(Response::HTTP_INTERNAL_SERVER_ERROR, self::CUSTOM_FIELDS_AWARE_LABEL_PROPERTY_NOT_DEFINED, 'Entity label_property "{{ labelProperty }}" is not defined in fields', ['labelProperty' => $labelProperty]); |
||
24 | } |
||
25 | |||
26 | public static function labelPropertyWrongType(string $labelProperty): self |
||
29 | } |
||
30 | } |
||
31 |