/** * Get the raw data for this part of the upgrade. * * @return array * @since 0.4.4 * @throws Exception */ protected function &getSourceData() { $rows = parent::getSourceData(); // Set up the mapping table for the old groups to the new groups. $groupMap = jUpgradeUsergroups::getUsergroupIdMap(); // Set up the mapping table for the ARO id's to the new user id's. $userMap = $this->getUserIdAroMap(); // Do some custom post processing on the list. // The schema for old group map is: group_id, section_value, aro_id // The schema for new groups is: user_id, group_id foreach ($rows as &$row) { $row['user_id'] = $userMap[$row['aro_id']]; // Note, if we are here, these are custom groups we didn't know about. if ($row['group_id'] <= 30) { $row['group_id'] = $groupMap[$row['group_id']]; } // Remove unused fields. unset($row['section_value']); unset($row['aro_id']); } return $rows; }