<?php
declare(strict_types=1);

namespace App\Models;

use App\Core\Database;

final class Role
{
    public static function all(): array
    {
        return Database::instance()->fetchAll('SELECT * FROM roles ORDER BY id');
    }

    public static function find(int $id): ?array
    {
        return Database::instance()->fetch('SELECT * FROM roles WHERE id = :id', ['id' => $id]);
    }
}
