table = acadlix()->helper()->acadlix_table_prefix('enrollment_sources'); } public function revokeAccess($sourceType, $sourceId) { // 1. Build the base query for the target rows $query = $this->where('source_type', $sourceType) ->where('source_id', $sourceId); // 2. Check if the records exist before running the delete if (!$query->exists()) { return false; } // 3. Delete all matching rows (wipes out single courses, or multiple courses from a bundle) $query->delete(); return true; } public function updateAccess($sourceType, $sourceId, array $values) { // Mass-updates all matching course rows tied to this source origin return $this->where('source_type', $sourceType) ->where('source_id', $sourceId) ->update($values); } } }