12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- // Copyright 2019 Hackware SpA <human@hackware.cl>
- // "Hackware Web Services Core" is released under the MIT License terms.
- namespace Hawese\Core\Exceptions;
- use Exception;
- class UnknownForeignObjectException extends Exception
- {
- protected $detail = [];
- protected $statusCode;
- public function __construct($model, $attribute)
- {
- parent::__construct(
- 'Unknown foreign object', // message
- 2 // code
- );
- $this->statusCode = 400;
- $this->detail = [
- 'model' => $model,
- 'attribute' => $attribute
- ];
- }
- public function getStatusCode(): int
- {
- return $this->statusCode;
- }
- public function getDetail()
- {
- return $this->detail;
- }
- }
|