fipamo/app/Repositories/PageRepository.php
ro 177f29802b
added page repository and interface
plugged in classes for a page repository to handle editing and
retrieving page content and an interface class for the controller to talk to to
keep the methodoloy seperate from the controller to keep it all clean

now whatever changes that need to be made won't bother the controller
because it will always be looking for the same functions. super sweet
2024-03-05 13:27:27 -06:00

54 lines
1.1 KiB
PHP

<?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)
{
}
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);
}
}