| 1 | <?php |
||
| 2 | |||
| 3 | namespace Isswp101\Persimmon\Contracts; |
||
| 4 | |||
| 5 | use Isswp101\Persimmon\Exceptions\ModelNotFoundException; |
||
| 6 | |||
| 7 | interface Persistencable |
||
| 8 | { |
||
| 9 | public function createPersistence(): PersistenceContract; |
||
| 10 | |||
| 11 | public function save(array $columns): void; |
||
| 12 | |||
| 13 | public function delete(): void; |
||
| 14 | |||
| 15 | public static function create(array $attributes): static; |
||
| 16 | |||
| 17 | public static function find(int|string $id, array $columns = []): static|null; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 18 | |||
| 19 | /** |
||
| 20 | * @param int|string $id |
||
| 21 | * @param array $columns |
||
| 22 | * @return static |
||
| 23 | * @throws ModelNotFoundException |
||
| 24 | */ |
||
| 25 | public static function findOrFail(int|string $id, array $columns = []): static; |
||
| 26 | |||
| 27 | public static function destroy(int|string $id): void; |
||
| 28 | |||
| 29 | public static function search(array $query): array; |
||
| 30 | |||
| 31 | public static function first(array $query): static|null; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param array $query |
||
| 35 | * @return static |
||
| 36 | * @throws ModelNotFoundException |
||
| 37 | */ |
||
| 38 | public static function firstOrFail(array $query): static; |
||
| 39 | |||
| 40 | public static function all(array $query): array; |
||
| 41 | } |
||
| 42 |