mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Added Money->addToQuery() to work around changes in the ORM which require database columns to be explcitly selected
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76664 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
2b042be1ff
commit
4085b3e654
@ -85,6 +85,12 @@ class Money extends DBField implements CompositeDBField {
|
||||
$manipulation['fields'][$this->name.'Currency'] = $this->prepValueForDB($this->getCurrency());
|
||||
$manipulation['fields'][$this->name.'Amount'] = $this->getAmount();
|
||||
}
|
||||
|
||||
function addToQuery(&$query) {
|
||||
parent::addToQuery($query);
|
||||
$query->select[] = $this->name . "Amount";
|
||||
$query->select[] = $this->name . "Currency";
|
||||
}
|
||||
|
||||
function setValue($value,$record=null) {
|
||||
if($record && isset($record[$this->name . 'Currency']) && isset($record[$this->name . 'Amount'])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user