DataObjects/Events.php
[Pman.Core] / DataObjects / Events.php
index a7f6294..d1dba13 100644 (file)
@@ -630,34 +630,20 @@ class Pman_Core_DataObjects_Events extends DB_DataObject
                 continue;
             }
             
-            $pk = $table->keys();
-            
-            $affects  = array();
-        
-            $all_links = $GLOBALS['_DB_DATAOBJECT']['LINKS'][$this->_database];
-
-            foreach($all_links as $tbl => $links) {
-                foreach($links as $col => $totbl_col) {
-                    $to = explode(':', $totbl_col);
-                    if ($to[0] != $this->tableName()) {
-                        continue;
-                    }
-
-                    $affects[$tbl . '.' . $col] = $table->tableName() . '.' . ((empty($pk)) ? 'id' : $pk[0]);
-                }
-            }
-            
             unset($d['_table']);
             
             $table->setFrom($d);
             
-            $table->insert();
+            /*
+             * need to use the old id
+             */
+            $table->id = $d['id'];
             
-            print_R($affects);exit;
+            $table->sequenceKey(false,false);
             
+            $table->insert();     
         }
         
-        print_R($log);exit;
-        
+        $roo->jok('RESTORE');
     }
 }