This commit is contained in:
@@ -3,9 +3,12 @@
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
use App\Models\Concerns\SchoolYearAutoFillTrait;
|
||||
|
||||
class StaffModel extends Model
|
||||
{
|
||||
use SchoolYearAutoFillTrait;
|
||||
|
||||
protected $table = 'staff';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
@@ -22,8 +25,13 @@ class StaffModel extends Model
|
||||
'role_name',
|
||||
'active_role',
|
||||
'created_at',
|
||||
'updated_at'
|
||||
'updated_at',
|
||||
'school_year',
|
||||
];
|
||||
protected $validationRules = [
|
||||
'school_year' => 'required|string|max_length[9]',
|
||||
];
|
||||
|
||||
|
||||
protected $useTimestamps = false; // Managed manually in controller
|
||||
|
||||
@@ -51,7 +59,7 @@ class StaffModel extends Model
|
||||
return false;
|
||||
}
|
||||
|
||||
unset($data['school_year'], $data['status']);
|
||||
unset($data['status']);
|
||||
|
||||
$existing = $this->where('user_id', $data['user_id'])->first();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user