<?php

namespace App\Models;

use CodeIgniter\Model;

class ServiceModel extends Model
{
    protected $table            = 'm_services';
    protected $primaryKey       = 'service_id';
    protected $useAutoIncrement = true;
    protected $returnType       = 'array';
    protected $useSoftDeletes   = false;

    protected $allowedFields    = [
        'name', 
        'icon', 
        'order',
        'is_active'
    ];

    protected $useTimestamps = false; // Change to true if `created_at` and `updated_at` fields exist

    /**
     * Get all active services
     */
    public function getActiveServices()
    {
        return $this->where('is_active', 1)->findAll();
    }
}
