<?php

namespace App\Models;

use App\Core\Model;

class LoanType extends Model
{
    protected $table = 'loan_types';
    protected $primaryKey = 'id';

    public function getActive()
    {
        $stmt = $this->db->query("SELECT * FROM {$this->table} WHERE is_active = 1 ORDER BY name ASC");
        return $stmt->fetchAll(\PDO::FETCH_OBJ);
    }
}
