Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace Adldap\Models; |
| 4 | |
| 5 | use Adldap\AdldapException; |
| 6 | |
| 7 | /** |
| 8 | * Class ModelDoesNotExistException. |
| 9 | * |
| 10 | * Thrown when a model being saved / updated does not actually exist. |
| 11 | */ |
| 12 | class ModelDoesNotExistException extends AdldapException |
| 13 | { |
| 14 | /** |
| 15 | * The class name of the model that does not exist. |
| 16 | * |
| 17 | * @var string |
| 18 | */ |
| 19 | protected $model; |
| 20 | |
| 21 | /** |
| 22 | * Sets the model that does not exist. |
| 23 | * |
| 24 | * @param string $model |
| 25 | * |
| 26 | * @return ModelDoesNotExistException |
| 27 | */ |
| 28 | public function setModel($model) |
| 29 | { |
| 30 | $this->model = $model; |
| 31 | |
| 32 | $this->message = "Model [{$model}] does not exist."; |
| 33 | |
| 34 | return $this; |
| 35 | } |
| 36 | } |