/** * Assign the next possible root via cycle. * @param GWF_Page $page */ private function newRoot(GWF_Page $page) { $oid = $page->getOtherID(); $tablename = $page->getTableName(); if (false === ($nextid = $page->selectVar('page_id', "page_otherid={$oid} AND page_id!={$oid}", 'page_create_date ASC'))) { return false; } return $page->update("page_otherid={$nextid}", "page_otherid={$oid}"); }