| 1 | <?php |
||
| 26 | class CannotInsertRecord extends Exception |
||
| 27 | { |
||
| 28 | /** |
||
| 29 | * The record submitted for insertion. |
||
| 30 | * |
||
| 31 | * @var array |
||
| 32 | */ |
||
| 33 | protected $record; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Validator which did not validated the data. |
||
| 37 | * |
||
| 38 | * @var string |
||
| 39 | */ |
||
| 40 | protected $name = ''; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Create an Exception from a record insertion into a stream. |
||
| 44 | */ |
||
| 45 | public static function triggerOnInsertion(array $record): self |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Create an Exception from a Record Validation. |
||
| 55 | */ |
||
| 56 | public static function triggerOnValidation(string $name, array $record): self |
||
| 64 | |||
| 65 | 6 | /** |
|
| 66 | 6 | * return the validator name. |
|
| 67 | 6 | * |
|
| 68 | */ |
||
| 69 | 6 | public function getName(): string |
|
| 73 | |||
| 74 | /** |
||
| 75 | * return the invalid data submitted. |
||
| 76 | * |
||
| 77 | 2 | */ |
|
| 78 | public function getRecord(): array |
||
| 82 | } |
||
| 83 |