2024-03-05 20:27:27 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Repositories;
|
|
|
|
|
|
|
|
use App\Interfaces\PageRepositoryInterface;
|
|
|
|
use App\Services\SettingsService;
|
|
|
|
use App\Services\ContentService;
|
|
|
|
use App\Services\PaginateService;
|
|
|
|
|
|
|
|
class PageRepository implements PageRepositoryInterface
|
|
|
|
{
|
|
|
|
protected $content;
|
|
|
|
protected $setttings;
|
|
|
|
protected $paginate;
|
|
|
|
protected $pages;
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
ContentService $contentService,
|
|
|
|
SettingsService $settingsService,
|
|
|
|
PaginateService $paginateService
|
|
|
|
) {
|
|
|
|
$this->content = $contentService;
|
|
|
|
$this->settings = $settingsService;
|
|
|
|
$this->paginate = $paginateService;
|
|
|
|
$this->pages = $this->content->loadAllPages();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getAll()
|
|
|
|
{
|
|
|
|
return $this->pages;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getById($uuid)
|
|
|
|
{
|
2024-03-05 22:49:30 +01:00
|
|
|
return $this->pages->where('uuid', $uuid);
|
2024-03-05 20:27:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function delete($uuid)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function create(array $page)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function update($uuid, array $page)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getGroup($num, $limit, $sort = "all")
|
|
|
|
{
|
|
|
|
return $this->paginate->getPage($num, $limit, $sort);
|
|
|
|
}
|
|
|
|
}
|