Generator.php
[Pman.Core] / Generator.php
index d071b43..0038cb6 100644 (file)
@@ -361,6 +361,7 @@ class Pman_Core_Generator extends DB_DataObject_Generator
                    die("No existing DataObject file found for table {$this->table} 
             
 - either add it to Pman_Builder[skip_tables] or\n
+- run generator and specify that module..
 - create an empty file in the related Module/DataObjects directory
 eg. 
 touch Pman/????/DataObjects/".ucfirst($this->table).".php
@@ -368,7 +369,8 @@ touch Pman/????/DataObjects/".ucfirst($this->table).".php
    ");
                 }
                 // use mods to determine where it should output to..
-                $this->modmap[$tn] = $mods;
+                //var_dump($mods);exit;
+                $this->modmap[$tn] = $mods[0];
                 
                 
             }
@@ -418,7 +420,8 @@ touch Pman/????/DataObjects/".ucfirst($this->table).".php
             
            
                 // file_get_contents???
-            $oldcontents = file_get_contents($orig);
+            
+            $oldcontents = file_exists($orig) ? file_get_contents($orig) : '';
             
              
             echo "GENERATE: " .   $this->classname  . ($cli ? "\n" : "<BR>");