<?php

namespace Modules\Settings\Models;

use CodeIgniter\Model;

class PaymentMethodsModel extends Model
{
    protected $table = 'payment_methods';
    protected $primaryKey = 'id';

    protected $allowedFields = [ 'name', 'method_code', 'icon', 'processing_fee', 'min_amount', 'max_amount', 'sort_order', 'description', 'status'];

    protected $returnType     = 'array';
    protected $useTimestamps  = true;
    protected $useSoftDeletes = true;

    
    public function getAll()
    {
        $status = 1;
        $builder = $this->db->table('payment_methods');
        $builder->where('status', $status);
        return $result = $builder->get()->getResult();
    }

}