mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Fixed PHP notice errors in MoneyField
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77906 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
30165bd1da
commit
4a9b100e31
@ -72,20 +72,17 @@ class MoneyField extends FormField {
|
||||
$this->value = $val;
|
||||
|
||||
if(is_array($val)) {
|
||||
$currency = $val['Currency'];
|
||||
$amount = $val['Amount'];
|
||||
$this->fieldCurrency->setValue($val['Currency']);
|
||||
$this->fieldAmount->setValue($val['Amount']);
|
||||
} elseif($val instanceof Money) {
|
||||
$currency = $val->getCurrency();
|
||||
$amount = $val->getAmount();
|
||||
$this->fieldCurrency->setValue($val->getCurrency());
|
||||
$this->fieldAmount->setValue($val->getAmount());
|
||||
}
|
||||
|
||||
// @todo Format numbers according to current locale, incl.
|
||||
// decimal and thousands signs, while respecting the stored
|
||||
// precision in the database without truncating it during display
|
||||
// and subsequent save operations
|
||||
|
||||
$this->fieldCurrency->setValue($currency);
|
||||
$this->fieldAmount->setValue($amount);
|
||||
}
|
||||
|
||||
function saveInto($dataObject) {
|
||||
|
Loading…
Reference in New Issue
Block a user