UpdateDatabase.php
authorAlan Knowles <alan@roojs.com>
Fri, 15 Nov 2013 06:19:06 +0000 (14:19 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 15 Nov 2013 06:19:06 +0000 (14:19 +0800)
UpdateDatabase.php

index fe9b67c..afd058d 100644 (file)
@@ -90,33 +90,19 @@ class Pman_Xtuple_UpdateDatabase extends Pman
         
         
     }
-    function jsonImportFromArray($opts)
-    {
-        foreach($this->opts as $o=>$v) {
-            if (!preg_match('/^json-/', $o) || empty($v)) {
-                continue;
-            }
-            $type = str_replace('_', '-', substr($o,6));
-            $data= json_decode(file_get_contents($file),true);
-            DB_DataObject::factory($type)->importFromArray($data);
-            
-        }
-        
-        
-        
+    
     }
     
     
-    function get($k = '',$opt)
+    function get($k = '',$opts)
     {
         $k = strtolower($k);
         
-        $this->opts = $opt;
+        $this->opts = $opts;
         
         require_once 'Pman/Core/UpdateDatabase.php';
         
-         
-        
+        Pman_Core_UpdateDatabase::jsonImportFromArray($opts)
           
         
         $this->updateData($k);