| 1 | <?php |
||
| 20 | class EntityNotFoundException extends RuntimeException |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * Id of the affected model. |
||
| 24 | * |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | protected $id; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Name of the affected model. |
||
| 31 | * |
||
| 32 | * @var string |
||
| 33 | */ |
||
| 34 | protected $model; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Set the affected model. |
||
| 38 | * |
||
| 39 | * @param string $model |
||
| 40 | * @param int $id |
||
| 41 | * |
||
| 42 | * @return void |
||
|
|
|||
| 43 | */ |
||
| 44 | public function __construct($model, $id) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Get the affected model. |
||
| 53 | * |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | public function getModel() |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Get the affected model Id. |
||
| 63 | * |
||
| 64 | * @return string |
||
| 65 | */ |
||
| 66 | public function getId() |
||
| 70 | } |
||
| 71 |
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.