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']); } }