remove codeigniter
This commit is contained in:
@@ -73,12 +73,12 @@ class UserRole extends BaseModel
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
* CI-compatible methods (converted)
|
||||
* legacy-compatible methods (converted)
|
||||
* ============================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* CI: getRolesByUserId($userId)
|
||||
* legacy: getRolesByUserId($userId)
|
||||
* Returns: [ ['role_name' => 'parent'], ['role_name' => 'teacher'] ]
|
||||
*/
|
||||
public static function getRolesByUserId(int $userId): array
|
||||
@@ -96,7 +96,7 @@ class UserRole extends BaseModel
|
||||
}
|
||||
|
||||
/**
|
||||
* CI: updateOrInsertRole($userId, $roleId)
|
||||
* legacy: updateOrInsertRole($userId, $roleId)
|
||||
* Idempotent (does nothing if already exists and not soft-deleted).
|
||||
* If the row exists but is soft-deleted, restores it.
|
||||
*/
|
||||
@@ -131,12 +131,12 @@ class UserRole extends BaseModel
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
* Replacement for the CI "create()" method (query only)
|
||||
* Replacement for the legacy "create()" method (query only)
|
||||
* ============================================================
|
||||
* In Laravel, view rendering belongs in Controllers, not Models.
|
||||
* This returns the user list that your CI method was building.
|
||||
* This returns the user list that your legacy method was building.
|
||||
*
|
||||
* CI logic:
|
||||
* legacy logic:
|
||||
* users joined to roles through user_roles, excluding parent/teacher,
|
||||
* groupBy users.id to avoid duplicates.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user