31 lines
778 B
PHP
31 lines
778 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\SchoolYearAutoFillTrait;
|
|
use CodeIgniter\Model;
|
|
|
|
class StudentYearStatusModel extends Model
|
|
{
|
|
use SchoolYearAutoFillTrait;
|
|
|
|
protected $table = 'student_year_status';
|
|
protected $primaryKey = 'id';
|
|
protected $returnType = 'array';
|
|
protected $useAutoIncrement = true;
|
|
protected $useTimestamps = true;
|
|
protected $createdField = 'created_at';
|
|
protected $updatedField = 'updated_at';
|
|
protected $allowedFields = [
|
|
'student_id',
|
|
'school_year',
|
|
'is_new',
|
|
];
|
|
|
|
protected $validationRules = [
|
|
'student_id' => 'required|is_natural_no_zero',
|
|
'school_year' => 'required|regex_match[/^\d{4}-\d{4}$/]',
|
|
'is_new' => 'required|in_list[0,1]',
|
|
];
|
|
}
|