<?php
/// file: app/Models/Service.php

declare(strict_types=1);

namespace App\Models;

use App\Core\Model;
use PDO;

final class Service extends Model
{
    protected static function table(): string
    {
        return 'services';
    }

    /** @return list<array<string, mixed>> */
    public static function published(): array
    {
        $st = self::pdo()->prepare('SELECT * FROM services WHERE status = ? ORDER BY sort_order ASC, id ASC');
        $st->execute(['published']);
        return $st->fetchAll(PDO::FETCH_ASSOC) ?: [];
    }
}
