| 1 | <?php |
||
| 9 | class EntityNotFoundException extends RuntimeException |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Id of the affected model. |
||
| 13 | * |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | protected $id; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Name of the affected model. |
||
| 20 | * |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | protected $model; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Set the affected model. |
||
| 27 | * |
||
| 28 | * @param string $model |
||
| 29 | * @param int $id |
||
| 30 | * |
||
| 31 | * @return void |
||
|
|
|||
| 32 | */ |
||
| 33 | public function __construct($model, $id) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Get the affected model. |
||
| 42 | * |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | public function getModel(): string |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Get the affected model Id. |
||
| 52 | * |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function getId(): string |
||
| 59 | } |
||
| 60 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.