37 lines
786 B
PHP
37 lines
786 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
use App\Models\Concerns\SchoolYearAutoFillTrait;
|
|
|
|
class InvoiceEventModel extends Model
|
|
{
|
|
use SchoolYearAutoFillTrait;
|
|
|
|
protected $table = 'invoice_event';
|
|
protected $primaryKey = 'id';
|
|
|
|
protected $allowedFields = [
|
|
'invoice_id',
|
|
'event_name',
|
|
'description',
|
|
'amount',
|
|
'semester',
|
|
'school_year',
|
|
'updated_by',
|
|
'created_at',
|
|
'updated_at'
|
|
];
|
|
protected $validationRules = [
|
|
'school_year' => 'required|string|max_length[9]',
|
|
];
|
|
|
|
|
|
protected $useTimestamps = true;
|
|
protected $createdField = 'created_at';
|
|
protected $updatedField = 'updated_at';
|
|
|
|
protected $returnType = 'array'; // or 'object' if you prefer
|
|
}
|