Files
breadcrumb-the-shire/lib/Repository/Content/PageRepository.php

26 lines
534 B
PHP
Raw Normal View History

2026-02-04 23:31:53 +01:00
<?php
2026-02-11 19:28:12 +01:00
namespace MintyPHP\Repository\Content;
2026-02-04 23:31:53 +01:00
use MintyPHP\DB;
class PageRepository
{
private static function unwrap(?array $row): ?array
{
if (!$row) {
return null;
}
return $row['pages'] ?? $row;
}
public static function findBySlug(string $slug): ?array
{
$row = DB::selectOne(
'select id, uuid, slug, created_by, modified_by, created, modified from pages where slug = ? limit 1',
$slug
);
return self::unwrap($row);
}
}