<?php

class PaymentMethod extends Model
{
    protected string $table = 'payment_methods';

    public function allWithAccount(): array
    {
        return $this->db->query(
            "SELECT pm.*, fa.account_name
             FROM payment_methods pm
             LEFT JOIN finance_accounts fa ON fa.id = pm.finance_account_id
             ORDER BY pm.is_active DESC, pm.method_name ASC"
        )->fetchAll();
    }
}
