mirror of
https://github.com/koel/koel
synced 2024-12-19 09:03:07 +00:00
32 lines
835 B
PHP
32 lines
835 B
PHP
<?php
|
|
|
|
namespace App\Repositories\Contracts;
|
|
|
|
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Collection;
|
|
|
|
/** @template T of Model */
|
|
interface RepositoryInterface
|
|
{
|
|
/** @return T */
|
|
public function getOne($id): Model;
|
|
|
|
/** @return T */
|
|
public function getOneBy(array $params): Model;
|
|
|
|
/** @return T|null */
|
|
public function findOne($id): ?Model;
|
|
|
|
/** @return T|null */
|
|
public function findOneBy(array $params): ?Model;
|
|
|
|
/** @return Collection<array-key, T> */
|
|
public function getMany(array $ids, bool $preserveOrder = false): Collection;
|
|
|
|
/** @return Collection<int, T> */
|
|
public function getAll(): EloquentCollection;
|
|
|
|
/** @return T|null */
|
|
public function findFirstWhere(...$params): ?Model;
|
|
}
|