]> git.mjollnir.org Git - moodle.git/commitdiff
Added one more configuration parameter to disable inline SQL to be added in enum...
authorstronk7 <stronk7>
Wed, 16 Aug 2006 18:37:33 +0000 (18:37 +0000)
committerstronk7 <stronk7>
Wed, 16 Aug 2006 18:37:33 +0000 (18:37 +0000)
lib/xmldb/classes/generators/XMLDBGenerator.class.php

index ec6f07d0d2e3aa8ea8b1655f140875b8257c9ac3..ac4b497089f187596d448caabc08fba60615636d 100644 (file)
@@ -63,6 +63,7 @@ class XMLDBgenerator {
     var $sequence_name = 'auto_increment'; //Particular name for inline sequences in this generator
     var $sequence_only = false; //To avoid to output the rest of the field specs, leaving only the name and the sequence_name variable
 
+    var $enum_inline_code = true; //Does the generator need to add inline code in the column definition
     var $enum_extra_code = true; //Does the generator need to add extra code to generate code for the enums in the table
 
     var $add_table_comments  = true;  // Does the generator need to add code for table comments
@@ -257,7 +258,7 @@ class XMLDBgenerator {
     /// The name
         $field = $this->getEncQuoted($xmldb_field->getName());
     /// The type and length (if the field isn't enum)
-        if (!$xmldb_field->getEnum()) {
+        if (!$xmldb_field->getEnum() || $this->enum_inline_code == false) {
             $field .= ' ' . $this->getTypeSQL($xmldb_field->getType(), $xmldb_field->getLength(), $xmldb_field->getDecimals());
         } else {
         /// call to custom function
@@ -431,10 +432,10 @@ class XMLDBgenerator {
     }
 
     /**
-     * Given one XMLDB Field, return its enum SQL
+     * Given one XMLDB Field, return its enum SQL to be added inline with the column definition
      */
     function getEnumSQL ($xmldb_field) {
-        return 'code for inline enum declaration goes to function getEnumSQL()';
+        return 'code for inline enum declaration goes to function getEnumSQL(). Can be disabled with enum_inline_code=false';
     }
 
     /**