]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - extlib/DB/DataObject/Generator.php
add back in # and @ for links
[quix0rs-gnu-social.git] / extlib / DB / DataObject / Generator.php
index e14e3ef7f9fac759c710202253002b95328f998f..17d310f57c3e3a1983e329eb8dd3dee2937060cb 100644 (file)
@@ -15,7 +15,7 @@
  * @author     Alan Knowles <alan@akbkhome.com>
  * @copyright  1997-2006 The PHP Group
  * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
- * @version    CVS: $Id: Generator.php 284150 2009-07-15 23:27:59Z alan_k $
+ * @version    CVS: $Id: Generator.php 289384 2009-10-09 00:17:26Z alan_k $
  * @link       http://pear.php.net/package/DB_DataObject
  */
  
@@ -33,7 +33,7 @@
  /**
  * 
  * Config _$ptions
- * [DB_DataObject_Generator]
+ * [DB_DataObject]
  * ; optional default = DB/DataObject.php
  * extends_location =
  * ; optional default = DB_DataObject
@@ -632,7 +632,7 @@ class DB_DataObject_Generator extends DB_DataObject
                 echo "*****************************************************************\n".
                      "**               WARNING COLUMN NAME UNUSABLE                  **\n".
                      "** Found column '{$t->name}', of type  '{$t->type}'            **\n".
-                     "** Since this column name cannot be converted to a php variable **\n".
+                     "** Since this column name can't be converted to a php variable **\n".
                      "** name, and the whole idea of mapping would result in a mess  **\n".
                      "** This column has been ignored...                             **\n".
                      "*****************************************************************\n";
@@ -775,11 +775,9 @@ class DB_DataObject_Generator extends DB_DataObject
         //echo "Generating Class files:        \n";
         $options = &PEAR::getStaticProperty('DB_DataObject','options');
        
-        
-        if ($extends = @$options['extends']) {
-            $this->_extends = $extends;
-            $this->_extendsFile = $options['extends_location'];
-        }
+       $this->_extends = empty($options['extends']) ? $this->_extends : $options['extends'];
+       $this->_extendsFile = empty($options['extends_location']) ? $this->_extendsFile : $options['extends_location'];
 
         foreach($this->tables as $this->table) {
             $this->table        = trim($this->table);
@@ -814,7 +812,7 @@ class DB_DataObject_Generator extends DB_DataObject
     }
 
     /**
-     * class being extended (can be overridden by [DB_DataObject_Generator] extends=xxxx
+     * class being extended (can be overridden by [DB_DataObject] extends=xxxx
      *
      * @var    string
      * @access private
@@ -910,7 +908,7 @@ class DB_DataObject_Generator extends DB_DataObject
                 echo "*****************************************************************\n".
                      "**               WARNING COLUMN NAME UNUSABLE                  **\n".
                      "** Found column '{$t->name}', of type  '{$t->type}'            **\n".
-                     "** Since this column name cannot be converted to a php variable **\n".
+                     "** Since this column name can't be converted to a php variable **\n".
                      "** name, and the whole idea of mapping would result in a mess  **\n".
                      "** This column has been ignored...                             **\n".
                      "*****************************************************************\n";
@@ -1142,10 +1140,9 @@ class DB_DataObject_Generator extends DB_DataObject
         $options = &PEAR::getStaticProperty('DB_DataObject','options');
         $class_prefix  = empty($options['class_prefix']) ? '' : $options['class_prefix'];
         
-        if ($extends = @$options['extends']) {
-            $this->_extends = $extends;
-            $this->_extendsFile = $options['extends_location'];
-        }
+        $this->_extends = empty($options['extends']) ? $this->_extends : $options['extends'];
+       $this->_extendsFile = empty($options['extends_location']) ? $this->_extendsFile : $options['extends_location'];
         $classname = $this->classname = $this->getClassNameFromTableName($this->table);
         
         $out = $this->_generateClassTable();