示例#1
0
 /**
  * @see DBHelper::oneColumnSQLRep()
  */
 protected function oneColumnSQLRep($fieldDef, $ignoreRequired = false, $table = '', $return_as_array = false)
 {
     $ref = parent::oneColumnSQLRep($fieldDef, $ignoreRequired, $table, true);
     if ($ref['colType'] == 'nvarchar' || $ref['colType'] == 'nchar') {
         if (!empty($fieldDef['len'])) {
             $ref['colType'] .= "(" . $fieldDef['len'] . ")";
         } else {
             $ref['colType'] .= "(255)";
         }
     }
     if ($return_as_array) {
         return $ref;
     } else {
         return "{$ref['name']} {$ref['colType']} {$ref['default']} {$ref['required']} {$ref['auto_increment']}";
     }
 }