Commit 1a21a43e authored by lsmith's avatar lsmith

- s/\$db/\$this->conn

- turned raiseError() calls into throw Exception
parent 260558e0
...@@ -44,8 +44,7 @@ class Doctrine_DataDict extends Doctrine_Connection_Module ...@@ -44,8 +44,7 @@ class Doctrine_DataDict extends Doctrine_Connection_Module
$type = !empty($current['type']) ? $current['type'] : null; $type = !empty($current['type']) ? $current['type'] : null;
if (!method_exists($this, "_compare{$type}Definition")) { if (!method_exists($this, "_compare{$type}Definition")) {
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, throw new Doctrine_DataDict_Exception('type "'.$current['type'].'" is not yet supported');
'type "'.$current['type'].'" is not yet supported', __FUNCTION__);
} }
if (empty($previous['type']) || $previous['type'] != $type) { if (empty($previous['type']) || $previous['type'] != $type) {
......
...@@ -64,7 +64,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict ...@@ -64,7 +64,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
case 'char': case 'char':
case 'text': case 'text':
$length = !empty($field['length']) $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; $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
...@@ -88,7 +88,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict ...@@ -88,7 +88,7 @@ class Doctrine_DataDict_Firebird extends Doctrine_DataDict
return 'DOUBLE PRECISION'; return 'DOUBLE PRECISION';
case 'decimal': case 'decimal':
$length = !empty($field['length']) ? $field['length'] : 18; $length = !empty($field['length']) ? $field['length'] : 18;
return 'DECIMAL('.$length.','.$db->options['decimal_places'].')'; return 'DECIMAL('.$length.','.$this->conn->options['decimal_places'].')';
} }
return ''; return '';
} }
......
...@@ -70,7 +70,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict ...@@ -70,7 +70,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false; $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'); : ($length ? 'VARCHAR('.$length.')' : 'TEXT');
case 'clob': case 'clob':
if (!empty($field['length'])) { if (!empty($field['length'])) {
...@@ -103,7 +103,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict ...@@ -103,7 +103,7 @@ class Doctrine_DataDict_Mssql extends Doctrine_DataDict
return 'FLOAT'; return 'FLOAT';
case 'decimal': case 'decimal':
$length = !empty($field['length']) ? $field['length'] : 18; $length = !empty($field['length']) ? $field['length'] : 18;
return 'DECIMAL('.$length.','.$db->options['decimal_places'].')'; return 'DECIMAL('.$length.','.$this->conn->options['decimal_places'].')';
} }
return ''; return '';
} }
......
...@@ -61,7 +61,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict ...@@ -61,7 +61,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
case 'char': case 'char':
case 'varchar': case 'varchar':
$length = !empty($field['length']) $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; $fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
...@@ -85,7 +85,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict ...@@ -85,7 +85,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
case 'float': case 'float':
return 'NUMBER'; return 'NUMBER';
case 'decimal': 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 ...@@ -365,11 +365,11 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
case 'object': case 'object':
case 'varchar': case 'varchar':
$length = (isset($field['length']) && $field['length']) ? $field['length'] : null; $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; $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'); : ($length ? 'VARCHAR('.$length.')' : 'TEXT');
case 'clob': case 'clob':
...@@ -568,7 +568,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict ...@@ -568,7 +568,7 @@ class Doctrine_DataDict_Pgsql extends Doctrine_DataDict
{ {
/** /**
if (!empty($field['unsigned'])) { 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 ...@@ -106,11 +106,11 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict
return 'DATETIME'; return 'DATETIME';
case 'float': case 'float':
case 'double': case 'double':
return 'DOUBLE';//($db->options['fixed_float'] ? '('. return 'DOUBLE';//($this->conn->options['fixed_float'] ? '('.
//($db->options['fixed_float']+2).','.$db->options['fixed_float'].')' : ''); //($this->conn->options['fixed_float']+2).','.$this->conn->options['fixed_float'].')' : '');
case 'decimal': case 'decimal':
$length = !empty($field['length']) ? $field['length'] : 18; $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']); throw new Doctrine_DataDict_Sqlite_Exception('Unknown datatype ' . $field['type']);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment