From 4a9b100e31725304c52cb73faceb85edbcfd51f7 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 27 May 2009 00:59:07 +0000 Subject: [PATCH] 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 --- forms/MoneyField.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/forms/MoneyField.php b/forms/MoneyField.php index 4ce5f8fc8..dc2a23321 100644 --- a/forms/MoneyField.php +++ b/forms/MoneyField.php @@ -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) {