I just noticed that propel converts numeric values ββto strings in the created setter methods. My problem is that since I use German, float values ββare inserted with a semicolon instead of a period. For example: "3.5" leads to the string "3.5". I am using PostgreSQL, which obviously expects 3.5.
Version Information:
In case it matters, I use: PHP 5.3.9, Propel 1.6 with Symfony 2.2.
Details:
The table definition is as follows:
<table name="account_entry">
...
<column name="amount" type="decimal" size="12" scale="2" required="true" />
...
</table>
The generated setAmount () method is as follows:
public function setAmount($v)
{
if ($v !== null && is_numeric($v)) {
$v = (string) $v;
}
if ($this->amount !== $v) {
$this->amount = $v;
$this->modifiedColumns[] = AccountEntryPeer::AMOUNT;
}
return $this;
}
Saving an object results in a PostgreSQL error:
Invalid text representation: 7 ERROR: invalid input syntax for type numeric: "3,5"
, , . , float setAmount(). , float , .
, propel float ?
- ?
, , :
setlocale(LC_ALL, 'en_US');
$ae->setAmount(3.5);
setlocale(LC_ALL, 'de_DE');