<?php

namespace App\Models;

use CodeIgniter\Model;

class PolicyModel extends Model
{
    protected $table            = 'm_policy';
    protected $primaryKey       = 'policy_id';
   

    protected $allowedFields    = [
        'name', 
        'domestic', 
        'international', 
        'services_ids', 
        'is_active', 
        'org_id',
        'created_on', 
        'created_by', 
        'updated_on', 
        'updated_by', 
    ];

    protected $useTimestamps = false; // Set to true if you have created_at & updated_at fields

    public function getActivePolicies($orgId)
    {
        return $this->where(['is_active' => 1, 'org_id' => $orgId])->findAll();
    }
}
