protected function copyTable_k2_items($table) { $this->source = $this->destination = "#__{$table}"; // Clone table $this->cloneTable($this->source, $this->destination); // Get data $rows = parent::getSourceData('*'); // Do some custom post processing on the list. foreach ($rows as &$row) { $row['access'] = $row['access'] == 0 ? 1 : $row['access'] + 1; $row['params'] = $this->convertParams($row['params']); $row['plugins'] = $this->convertParams($row['plugins']); } $this->setDestinationData($rows); return true; }
/** * Copy kunena_categories table from old site to new site. * * You can create custom copy functions for all your tables. * * If you want to copy your table in many smaller chunks, * please store your custom state variables into $this->state and return false. * Returning false will force jUpgrade to call this function again, * which allows you to continue import by reading $this->state before continuing. * * @param string $table * @return boolean Ready (true/false) * @since 1.6.4 * @throws Exception */ protected function copyTable_kunena_categories($table) { $this->source = $this->destination = "#__{$table}"; // Clone table $this->cloneTable($this->source, $this->destination); // Get data $rows = parent::getSourceData('*'); // Do some custom post processing on the list. foreach ($rows as &$row) { $row['params'] = $this->convertParams($row['params']); if (!isset($row['accesstype']) || $row['accesstype'] == 'joomla.group') { if ($row['admin_access'] != 0) { $row['admin_access'] = $this->mapUserGroup($row['admin_access']); } if ($row['pub_access'] == -1) { // All registered $row['pub_access'] = 2; $row['pub_recurse'] = 1; } elseif ($row['pub_access'] == 0) { // Everybody $row['pub_access'] = 1; $row['pub_recurse'] = 1; } elseif ($row['pub_access'] == 1) { // Nobody $row['pub_access'] = 8; } else { // User groups $row['pub_access'] = $this->mapUserGroup($row['pub_access']); } } elseif ($row['accesstype'] == 'joomla.level') { // Convert Joomla access levels $row['access']++; } } $this->setDestinationData($rows); return true; }