37 lines
1009 B
PHP
37 lines
1009 B
PHP
<?php
|
|
|
|
namespace App\Repositories\Addon;
|
|
|
|
use App\Repositories\BaseCachedRepository;
|
|
|
|
class AddonCachedRepository extends BaseCachedRepository implements AddonRepositoryInterface
|
|
{
|
|
public function __construct(
|
|
public AddonRepository $addonRepository
|
|
) {
|
|
parent::__construct();
|
|
}
|
|
|
|
public function getModel()
|
|
{
|
|
return $this->addonRepository->getModel();
|
|
}
|
|
|
|
public function filter(
|
|
array $data = [],
|
|
array $relationships = [],
|
|
array $withCount = [],
|
|
array $select = ['*'],
|
|
bool $returnQuery = false
|
|
) {
|
|
if ($returnQuery || !empty($data['paginate'])) {
|
|
return $this->addonRepository->filter($data, $relationships, $withCount, $select, $returnQuery);
|
|
}
|
|
|
|
return $this->rememberFilter(
|
|
compact('data', 'relationships', 'withCount', 'select'),
|
|
fn () => $this->addonRepository->filter($data, $relationships, $withCount, $select, $returnQuery)
|
|
);
|
|
}
|
|
}
|