<?php

namespace App\Models;

use CodeIgniter\Model;

class StudentModel extends Model
{
    protected $table = 'student';

    protected $primaryKey = 'id';

    protected $allowedFields = [
        'first_name',
        'last_name',
        'address',
        'city',
        'contact_no_1',
        'contact_no_2',
        'guardian_name',
        'email',
        'status'
    ];

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

    //protected $useTimestamps = true;
}