1
0
mirror of synced 2024-12-14 07:06:04 +03:00

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

- turned raiseError() calls into throw Exception
This commit is contained in:
lsmith 2007-01-05 22:05:55 +00:00
parent 260558e032
commit 1a21a43e52
6 changed files with 1527 additions and 1528 deletions

View File

@ -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) {

View File

@ -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 '';
}

View File

@ -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 '';
}

View File

@ -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'].')';
}
}
/**

View File

@ -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";
}
*/

View File

@ -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']);
}