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

index ccda708..90b0c74 100644 (file)
@@ -105,28 +105,21 @@ class Pman_Core_UpdateDatabase extends Pman
         return true;
     }
      
-    function get($args, $opt)
+    function get($args, $opts)
     {
         $this->fixSequencesPgsql();exit;
-        $this->opts = $opt;
+        $this->opts = $opts;
         
         // ask all the modules to verify the opts
         
-        $this->checkOpts($opt);
+        $this->checkOpts($opts);
         
         
-         
-        
-        if($args == 'Company'){
-            if(empty($opt['name']) || empty($opt['comptype'])){
-                die("Missing company name or type! Try --name=[the name of company] -- comptype=[the type of company] \n");
-            }
-            
-            DB_DataObject::factory('companies')->initCompanies($this, $opt['name'], $opt['comptype']);
-            
-            die("DONE! \n");
+        if (!empty($opts['add-company')) {
+            DB_DataObject::factory('companies')->initCompanies($this, $opts);
         }
         
+        
         $this->importSQL();
         $this->runUpdateModulesData();