<?php

namespace App\Models;

use CodeIgniter\Model;

class ClassModel extends Model
{
    protected $table = 'class';

    protected $primaryKey = 'id';

    protected $allowedFields = [
        'name',
        'code',
        'description',
        'class_day',
        'started_date',
        'start_time',
        'end_time',
        'fee',
        'status',
        'class_type_id',
        'payment_type_id',
        'student_id',
        'grade_id'
    ];

    public function getActiveCount()
    {
        return $this->where('status', 1)->countAllResults();
    }

    //protected $useTimestamps = true;
}