remove codeigniter
This commit is contained in:
+16
-16
@@ -15,7 +15,7 @@ class Student extends BaseModel
|
||||
protected $table = 'students';
|
||||
|
||||
/**
|
||||
* CI: timestamps disabled
|
||||
* legacy: timestamps disabled
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
@@ -106,11 +106,11 @@ class Student extends BaseModel
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
* CI-compatible methods (converted)
|
||||
* legacy-compatible methods (converted)
|
||||
* ============================================================
|
||||
*/
|
||||
|
||||
/** CI: getNewStudents() */
|
||||
/** legacy: getNewStudents() */
|
||||
public static function getNewStudents(): array
|
||||
{
|
||||
return static::query()
|
||||
@@ -120,7 +120,7 @@ class Student extends BaseModel
|
||||
->all();
|
||||
}
|
||||
|
||||
/** CI: getNewStudentsWithParents() */
|
||||
/** legacy: getNewStudentsWithParents() */
|
||||
public static function getNewStudentsWithParents(): array
|
||||
{
|
||||
return DB::table('students')
|
||||
@@ -142,7 +142,7 @@ class Student extends BaseModel
|
||||
}
|
||||
|
||||
/**
|
||||
* CI: getNewStudentsWithParentsAndEmergency()
|
||||
* legacy: getNewStudentsWithParentsAndEmergency()
|
||||
* Picks one emergency contact via MIN(...) with groupBy student.
|
||||
*/
|
||||
public static function getNewStudentsWithParentsAndEmergency(): array
|
||||
@@ -170,7 +170,7 @@ class Student extends BaseModel
|
||||
}
|
||||
|
||||
/**
|
||||
* CI: getStudentsWithParentsAndEmergency(?schoolYear, ?isNew)
|
||||
* legacy: getStudentsWithParentsAndEmergency(?schoolYear, ?isNew)
|
||||
*/
|
||||
public static function getStudentsWithParentsAndEmergency(?string $schoolYear = null, ?int $isNew = null): array
|
||||
{
|
||||
@@ -209,26 +209,26 @@ class Student extends BaseModel
|
||||
->all();
|
||||
}
|
||||
|
||||
/** CI: getStudentSchoolIdByStudentId() */
|
||||
/** legacy: getStudentSchoolIdByStudentId() */
|
||||
public static function getStudentSchoolIdByStudentId(int $studentId): ?string
|
||||
{
|
||||
$v = static::query()->where('id', $studentId)->value('school_id');
|
||||
return $v !== null ? (string) $v : null;
|
||||
}
|
||||
|
||||
/** CI: getAllStudents() */
|
||||
/** legacy: getAllStudents() */
|
||||
public static function getAllStudents()
|
||||
{
|
||||
return static::query()->get();
|
||||
}
|
||||
|
||||
/** CI: getTotalStudents() */
|
||||
/** legacy: getTotalStudents() */
|
||||
public static function getTotalStudents(): int
|
||||
{
|
||||
return (int) static::query()->count();
|
||||
}
|
||||
|
||||
/** CI: getFullNameById() => returns [firstname, lastname] or null */
|
||||
/** legacy: getFullNameById() => returns [firstname, lastname] or null */
|
||||
public static function getFullNameById($studentId): ?array
|
||||
{
|
||||
$student = static::query()->find($studentId);
|
||||
@@ -242,13 +242,13 @@ class Student extends BaseModel
|
||||
return ['firstname' => $first, 'lastname' => $last];
|
||||
}
|
||||
|
||||
/** CI: getFullName($student array) */
|
||||
/** legacy: getFullName($student array) */
|
||||
public static function getFullName(array $student): string
|
||||
{
|
||||
return trim(($student['firstname'] ?? '') . ' ' . ($student['lastname'] ?? ''));
|
||||
}
|
||||
|
||||
/** CI: getLastRegistrationDate($ParentId) */
|
||||
/** legacy: getLastRegistrationDate($ParentId) */
|
||||
public static function getLastRegistrationDate(int $parentId): ?array
|
||||
{
|
||||
$row = static::query()
|
||||
@@ -261,7 +261,7 @@ class Student extends BaseModel
|
||||
}
|
||||
|
||||
/**
|
||||
* CI: getByClassAndYear($class_section_id, $school_year, ?semester ignored)
|
||||
* legacy: getByClassAndYear($class_section_id, $school_year, ?semester ignored)
|
||||
*/
|
||||
public static function getByClassAndYear(int $classSectionId, string $schoolYear, ?string $semester = null): array
|
||||
{
|
||||
@@ -311,7 +311,7 @@ class Student extends BaseModel
|
||||
}
|
||||
|
||||
/**
|
||||
* CI: getStudentsWithClassAndEnrollment()
|
||||
* legacy: getStudentsWithClassAndEnrollment()
|
||||
* Keeps your original grouping so behavior doesn’t change.
|
||||
*/
|
||||
public static function getStudentsWithClassAndEnrollment(): array
|
||||
@@ -335,8 +335,8 @@ class Student extends BaseModel
|
||||
}
|
||||
|
||||
/**
|
||||
* CI: getStudentInfoByClassSectionId($classSectionId, $semester ignored, $schoolYear optional)
|
||||
* NOTE: In CI you appended updated_by from session; here we accept actor id.
|
||||
* legacy: getStudentInfoByClassSectionId($classSectionId, $semester ignored, $schoolYear optional)
|
||||
* NOTE: In legacy you appended updated_by from session; here we accept actor id.
|
||||
*/
|
||||
public static function getStudentInfoByClassSectionId(int $classSectionId, ?string $semester = null, ?string $schoolYear = null, ?int $actorId = null): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user