recreate project
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class SubjectCurriculumModel extends Model
|
||||
{
|
||||
protected $table = 'subject_curriculum_items';
|
||||
protected $primaryKey = 'id';
|
||||
protected $allowedFields = [
|
||||
'class_id',
|
||||
'subject',
|
||||
'unit_number',
|
||||
'unit_title',
|
||||
'chapter_name',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
protected $returnType = 'array';
|
||||
protected $useTimestamps = true;
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
|
||||
public function getOptionsForClass(int $classId, string $subject): array
|
||||
{
|
||||
return $this->where('class_id', $classId)
|
||||
->where('subject', $subject)
|
||||
->orderBy('unit_number', 'ASC')
|
||||
->orderBy('chapter_name', 'ASC')
|
||||
->findAll();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user