Files
alrahma_sunday_school/app/Models/AttendanceCommentTemplateModel.php
T
2026-02-10 22:11:06 -05:00

29 lines
631 B
PHP

<?php
namespace App\Models;
use CodeIgniter\Model;
class AttendanceCommentTemplateModel extends Model
{
protected $table = 'attendance_comment_template';
protected $primaryKey = 'id';
protected $returnType = 'array';
protected $useTimestamps = false;
protected $allowedFields = [
'min_score',
'max_score',
'template_text',
'is_active',
'created_at',
'updated_at',
];
public function getActiveTemplates(): array
{
return $this->where('is_active', 1)
->orderBy('min_score', 'DESC')
->findAll();
}
}