コード例 #1
0
ファイル: delivery.php プロジェクト: radjybaba/testserver
 public static function disable_all_Delivery_info($UID, $destination = 'user')
 {
     $dbObj = new dbAPI();
     $destination = dbAPI::get_db_name($destination);
     // disable old records
     $dbObj->disable_revision('', $destination . ".DELIVERY_BASE ", ' UID = ' . $UID . ' ');
     // disable old front record
     $links_tables_names = array('DELIVERY_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 = Delivery::get_relations_tables_names();
     for ($i = 0; $i < count($links_tables_names); $i++) {
         // prepare where statement
         if ($links_tables_names[$i] == 'R_LD2D') {
             $where_sttmnt = ' (PARENT_ID = ' . $UID . ' OR CHILD_ID = ' . $UID . ') ';
         } else {
             $where_sttmnt = ' (DELIVERY_BASE_ID = ' . $UID . ') ';
         }
         // disable old links records
         $dbObj->disable_revision('', $destination . "." . $links_tables_names[$i] . " ", $where_sttmnt);
     }
     return true;
 }