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

declare(strict_types=1);

namespace App\Models;

use App\Core\Database;
use PDO;

final class ProjectMedia
{
    /** @return list<array<string, mixed>> */
    public static function forProject(int $projectId): array
    {
        $st = Database::pdo()->prepare(
            'SELECT * FROM project_media WHERE project_id = ? ORDER BY sort_order ASC, id ASC'
        );
        $st->execute([$projectId]);
        return $st->fetchAll(PDO::FETCH_ASSOC) ?: [];
    }
}
