Beispiel #1
0
 private function migrateWikiPageParents($idWikiOld)
 {
     $result = $this->dbOld->query("SELECT * FROM wiki_pages" . " WHERE wiki_id =" . $idWikiOld . " and parent_id > 0");
     $wikipagesOld = $this->dbOld->getAssocArrays($result);
     foreach ($wikipagesOld as $wikipageOld) {
         $idWikiPageNew = $this->wikipagesMapping[$wikipageOld['id']];
         unset($wikipageOld['id']);
         // Update fields for new version of wiki page parent_id
         $wikipageOld['wiki_id'] = $this->wikisMapping[$idWikiOld];
         $wikipageOld['parent_id'] = $this->wikipagesMapping[$wikipageOld['parent_id']];
         $idWikiPageNew = $this->dbNew->update('wiki_pages', $wikipageOld, array('id' => idWikiPageNew));
     }
 }
Beispiel #2
0
 private function migrateIssuesParents($idProjectOld)
 {
     $result = $this->dbOld->select('issues', array('project_id' => $idProjectOld));
     $issuesOld = $this->dbOld->getAssocArrays($result);
     foreach ($issuesOld as $issueOld) {
         $idIssueOld = $issueOld['id'];
         if ($issueOld['parent_id'] > 0) {
             // Update parents for issues
             $issueUpdate['parent_id'] = $this->replaceIssue($issueOld['parent_id']);
             $idParentIssueNew = $this->dbNew->update('issues', $issueUpdate, array('id' => $this->issuesMapping[$issueOld['id']]));
             $this->issuesParentsMapping[$idIssueOld] = $idParentIssueNew;
         }
     }
 }