mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-01 05:39:10 +02:00
Updating all setter methods on DBMoney to return an instance of themselves
This commit is contained in:
parent
38e86f04d8
commit
daeb3d7abf
@ -103,10 +103,12 @@ class DBMoney extends DBComposite
|
|||||||
/**
|
/**
|
||||||
* @param string $currency
|
* @param string $currency
|
||||||
* @param bool $markChanged
|
* @param bool $markChanged
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setCurrency($currency, $markChanged = true)
|
public function setCurrency($currency, $markChanged = true)
|
||||||
{
|
{
|
||||||
$this->setField('Currency', $currency, $markChanged);
|
$this->setField('Currency', $currency, $markChanged);
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -120,10 +122,12 @@ class DBMoney extends DBComposite
|
|||||||
/**
|
/**
|
||||||
* @param float $amount
|
* @param float $amount
|
||||||
* @param bool $markChanged
|
* @param bool $markChanged
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setAmount($amount, $markChanged = true)
|
public function setAmount($amount, $markChanged = true)
|
||||||
{
|
{
|
||||||
$this->setField('Amount', (float)$amount, $markChanged);
|
$this->setField('Amount', (float)$amount, $markChanged);
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -145,11 +149,13 @@ class DBMoney extends DBComposite
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $locale
|
* @param string $locale
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setLocale($locale)
|
public function setLocale($locale)
|
||||||
{
|
{
|
||||||
$this->locale = $locale;
|
$this->locale = $locale;
|
||||||
$this->currencyLib->setLocale($locale);
|
$this->currencyLib->setLocale($locale);
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -214,10 +220,12 @@ class DBMoney extends DBComposite
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $arr
|
* @param array $arr
|
||||||
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setAllowedCurrencies($arr)
|
public function setAllowedCurrencies($arr)
|
||||||
{
|
{
|
||||||
$this->allowedCurrencies = $arr;
|
$this->allowedCurrencies = $arr;
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user