diff --git a/src/Exceptions/DocumentNotFoundException.php b/src/Exceptions/DocumentNotFoundException.php index 3ea372a..4be140b 100644 --- a/src/Exceptions/DocumentNotFoundException.php +++ b/src/Exceptions/DocumentNotFoundException.php @@ -4,13 +4,14 @@ namespace Matchory\Elasticsearch\Exceptions; -use Illuminate\Database\RecordsNotFoundException; +use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Support\Arr; +use Matchory\Elasticsearch\Model; use function count; use function implode; -class DocumentNotFoundException extends RecordsNotFoundException +class DocumentNotFoundException extends ModelNotFoundException { /** * Name of the affected Elasticsearch model. @@ -26,25 +27,15 @@ class DocumentNotFoundException extends RecordsNotFoundException */ protected $ids; - /** - * Get the affected Eloquent model. - * - * @return string - */ - public function getModel(): string - { - return $this->model; - } - /** * Set the affected Eloquent model and instance ids. * - * @param string $model - * @param string|array $ids + * @param class-string $model + * @param string|array $ids * * @return $this */ - public function setModel(string $model, $ids = []): self + public function setModel($model, $ids = []): self { $this->model = $model; $this->ids = Arr::wrap($ids); @@ -57,14 +48,4 @@ public function setModel(string $model, $ids = []): self return $this; } - - /** - * Get the affected Eloquent model IDs. - * - * @return string|array - */ - public function getIds() - { - return $this->ids; - } }