| 1 | <?php |
||
| 19 | class CannotInsertRecord extends Exception |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * The record submitted for insertion. |
||
| 23 | * |
||
| 24 | * @var array |
||
| 25 | */ |
||
| 26 | protected $record; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Validator which did not validated the data. |
||
| 30 | * |
||
| 31 | * @var string |
||
| 32 | */ |
||
| 33 | protected $name = ''; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Create an Exception from a record insertion into a stream. |
||
| 37 | */ |
||
| 38 | 3 | public static function triggerOnInsertion(array $record): self |
|
| 45 | |||
| 46 | /** |
||
| 47 | * Create an Exception from a Record Validation. |
||
| 48 | */ |
||
| 49 | 12 | public static function triggerOnValidation(string $name, array $record): self |
|
| 57 | |||
| 58 | /** |
||
| 59 | * return the validator name. |
||
| 60 | * |
||
| 61 | */ |
||
| 62 | 9 | public function getName(): string |
|
| 66 | |||
| 67 | /** |
||
| 68 | * return the invalid data submitted. |
||
| 69 | * |
||
| 70 | */ |
||
| 71 | 9 | public function getRecord(): array |
|
| 75 | } |
||
| 76 |