- use ATTR_DECIMAL_PLACES when defining a decimal field
This commit is contained in:
parent
4d1722fba4
commit
efc7baa19b
@ -93,7 +93,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.',' . $this->conn->options['decimal_places'] . ')';
|
return 'DECIMAL('.$length.','.$this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES).')';
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
||||||
|
@ -108,7 +108,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.','.$this->conn->options['decimal_places'].')';
|
return 'DECIMAL('.$length.','.$this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES).')';
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
||||||
|
@ -216,7 +216,8 @@ class Doctrine_DataDict_Mysql extends Doctrine_DataDict
|
|||||||
return 'DOUBLE';
|
return 'DOUBLE';
|
||||||
case 'decimal':
|
case 'decimal':
|
||||||
$length = !empty($field['length']) ? $field['length'] : 18;
|
$length = !empty($field['length']) ? $field['length'] : 18;
|
||||||
return 'DECIMAL(' . $length . ',' . 0 . ')'; //$this->dbh->options['decimal_places'] . ')';
|
var_dump('DECIMAL('.$length.','.$this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES).')');
|
||||||
|
return 'DECIMAL('.$length.','.$this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES).')';
|
||||||
}
|
}
|
||||||
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ class Doctrine_DataDict_Oracle extends Doctrine_DataDict
|
|||||||
case 'double':
|
case 'double':
|
||||||
return 'NUMBER';
|
return 'NUMBER';
|
||||||
case 'decimal':
|
case 'decimal':
|
||||||
return 'NUMBER(*,'.$this->conn->options['decimal_places'].')';
|
return 'NUMBER(*,'.$this->conn->getAttribute(Doctrine::ATTR_DECIMAL_PLACES).')';
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
throw new Doctrine_DataDict_Exception('Unknown field type \'' . $field['type'] . '\'.');
|
||||||
|
@ -115,6 +115,7 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
|
|||||||
Doctrine::ATTR_SEQCOL_NAME => 'id',
|
Doctrine::ATTR_SEQCOL_NAME => 'id',
|
||||||
Doctrine::ATTR_PORTABILITY => Doctrine::PORTABILITY_ALL,
|
Doctrine::ATTR_PORTABILITY => Doctrine::PORTABILITY_ALL,
|
||||||
Doctrine::ATTR_EXPORT => Doctrine::EXPORT_NONE,
|
Doctrine::ATTR_EXPORT => Doctrine::EXPORT_NONE,
|
||||||
|
Doctrine::ATTR_DECIMAL_PLACES => 2,
|
||||||
);
|
);
|
||||||
foreach ($attributes as $attribute => $value) {
|
foreach ($attributes as $attribute => $value) {
|
||||||
$old = $this->getAttribute($attribute);
|
$old = $this->getAttribute($attribute);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user