<?php
declare(strict_types=1);

namespace App\Models;

use App\Core\Model;
use PDO;

class CurrencyModel extends Model
{
    protected string $table = 'currencies';

    public function getAll(int $tenantId): array
    {
        $stmt = $this->db->prepare("SELECT * FROM currencies WHERE tenant_id = ? ORDER BY is_base DESC, name ASC");
        $stmt->execute([$tenantId]);
        return $stmt->fetchAll(PDO::FETCH_ASSOC);
    }
}
