recreate project

This commit is contained in:
root
2026-02-10 22:11:06 -05:00
commit 663c0cdbda
10149 changed files with 1379710 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class GradingLockModel extends Model
{
protected $table = 'grading_locks';
protected $primaryKey = 'id';
protected $returnType = 'array';
protected $useTimestamps = true;
protected $allowedFields = [
'class_section_id',
'semester',
'school_year',
'is_locked',
'locked_by',
'locked_at',
'created_at',
'updated_at',
];
public function getLock(int $classSectionId, string $semester, string $schoolYear): ?array
{
if ($classSectionId <= 0 || $semester === '' || $schoolYear === '') {
return null;
}
return $this->where('class_section_id', $classSectionId)
->where('semester', $semester)
->where('school_year', $schoolYear)
->orderBy('id', 'DESC')
->first();
}
public function isLocked(int $classSectionId, string $semester, string $schoolYear): bool
{
$row = $this->getLock($classSectionId, $semester, $schoolYear);
return !empty($row['is_locked']);
}
}