- s/\$db/\$this->conn
- turned raiseError() calls into throw Exception
This commit is contained in:
parent
260558e032
commit
1a21a43e52
@ -44,8 +44,7 @@ class Doctrine_DataDict extends Doctrine_Connection_Module
|
||||
$type = !empty($current['type']) ? $current['type'] : null;
|
||||
|
||||
if (!method_exists($this, "_compare{$type}Definition")) {
|
||||
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
|
||||
'type "'.$current['type'].'" is not yet supported', __FUNCTION__);
|
||||
throw new Doctrine_DataDict_Exception('type "'.$current['type'].'" is not yet supported');
|
||||
}
|
||||
|
||||
if (empty($previous['type']) || $previous['type'] != $type) {
|
||||
|
@ -64,7 +64,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
|
||||
case 'char':
|
||||
case 'text':
|
||||
$length = !empty($field['length'])
|
||||
? $field['length'] : 16777215; // TODO: $db->options['default_text_field_length'];
|
||||
? $field['length'] : 16777215; // TODO: $this->conn->options['default_text_field_length'];
|
||||
|
||||
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
|
||||
|
||||
@ -88,7 +88,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
|
||||
return 'DOUBLE PRECISION';
|
||||
case 'decimal':
|
||||
$length = !empty($field['length']) ? $field['length'] : 18;
|
||||
return 'DECIMAL('.$length.','.$db->options['decimal_places'].')';
|
||||
return 'DECIMAL('.$length.','.$this->conn->options['decimal_places'].')';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
|
||||
|
||||
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
|
||||
|
||||
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$db->options['default_text_field_length'].')')
|
||||
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->options['default_text_field_length'].')')
|
||||
: ($length ? 'VARCHAR('.$length.')' : 'TEXT');
|
||||
case 'clob':
|
||||
if (!empty($field['length'])) {
|
||||
@ -103,7 +103,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
|
||||
return 'FLOAT';
|
||||
case 'decimal':
|
||||
$length = !empty($field['length']) ? $field['length'] : 18;
|
||||
return 'DECIMAL('.$length.','.$db->options['decimal_places'].')';
|
||||
return 'DECIMAL('.$length.','.$this->conn->options['decimal_places'].')';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
|
||||
case 'char':
|
||||
case 'varchar':
|
||||
$length = !empty($field['length'])
|
||||
? $field['length'] : 16777215; // TODO: $db->options['default_text_field_length'];
|
||||
? $field['length'] : 16777215; // TODO: $this->conn->options['default_text_field_length'];
|
||||
|
||||
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
|
||||
|
||||
@ -85,7 +85,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
|
||||
case 'float':
|
||||
return 'NUMBER';
|
||||
case 'decimal':
|
||||
return 'NUMBER(*,'.$db->options['decimal_places'].')';
|
||||
return 'NUMBER(*,'.$this->conn->options['decimal_places'].')';
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -365,11 +365,11 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
|
||||
case 'object':
|
||||
case 'varchar':
|
||||
$length = (isset($field['length']) && $field['length']) ? $field['length'] : null;
|
||||
// TODO: $db->options['default_text_field_length'];
|
||||
// TODO: $this->conn->options['default_text_field_length'];
|
||||
|
||||
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
|
||||
|
||||
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$db->options['default_text_field_length'].')')
|
||||
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->options['default_text_field_length'].')')
|
||||
: ($length ? 'VARCHAR('.$length.')' : 'TEXT');
|
||||
|
||||
case 'clob':
|
||||
@ -568,7 +568,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
|
||||
{
|
||||
/**
|
||||
if (!empty($field['unsigned'])) {
|
||||
$db->warnings[] = "unsigned integer field \"$name\" is being declared as signed integer";
|
||||
$this->conn->warnings[] = "unsigned integer field \"$name\" is being declared as signed integer";
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -106,11 +106,11 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
|
||||
return 'DATETIME';
|
||||
case 'float':
|
||||
case 'double':
|
||||
return 'DOUBLE';//($db->options['fixed_float'] ? '('.
|
||||
//($db->options['fixed_float']+2).','.$db->options['fixed_float'].')' : '');
|
||||
return 'DOUBLE';//($this->conn->options['fixed_float'] ? '('.
|
||||
//($this->conn->options['fixed_float']+2).','.$this->conn->options['fixed_float'].')' : '');
|
||||
case 'decimal':
|
||||
$length = !empty($field['length']) ? $field['length'] : 18;
|
||||
return 'DECIMAL('.$length.','.$db->options['decimal_places'].')';
|
||||
return 'DECIMAL('.$length.','.$this->conn->options['decimal_places'].')';
|
||||
}
|
||||
throw new Doctrine_DataDict_Sqlite_Exception('Unknown datatype ' . $field['type']);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user