public static function disable_all_kbit_info($UID, $destination = 'user') { $dbObj = new dbAPI(); $destination = dbAPI::get_db_name($destination); // disable old records $dbObj->disable_revision('', $destination . ".KBIT_BASE ", ' UID = ' . $UID . ' '); // disable old front record $links_tables_names = array('KBIT_FRONT'); for ($i = 0; $i < count($links_tables_names); $i++) { // disable old links records $dbObj->disable_revision('', $destination . "." . $links_tables_names[$i] . " ", ' UID = ' . $UID . ' '); } // loop over links and copy records from content to user $links_tables_names = Kbit::get_relations_tables_names(); for ($i = 0; $i < count($links_tables_names); $i++) { // prepare where statement if ($links_tables_names[$i] == 'R_LK2K') { $where_sttmnt = ' (PARENT_ID = ' . $UID . ' OR CHILD_ID = ' . $UID . ') '; } else { $where_sttmnt = ' (KBIT_BASE_ID = ' . $UID . ') '; } // disable old links records $dbObj->disable_revision('', $destination . "." . $links_tables_names[$i] . " ", $where_sttmnt); } return true; }