Files
alrahma_sunday_school/app/Models/AttendanceCommentTemplateModel.php
2026-05-16 13:44:12 -04:00

29 lines
631 B
PHP
Executable File

<?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();
}
}