mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-04 23:28:41 +02: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
@ -86,6 +86,12 @@ class Money extends DBField implements CompositeDBField {
|
|||||||
$manipulation['fields'][$this->name.'Amount'] = $this->getAmount();
|
$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) {
|
function setValue($value,$record=null) {
|
||||||
if($record && isset($record[$this->name . 'Currency']) && isset($record[$this->name . 'Amount'])) {
|
if($record && isset($record[$this->name . 'Currency']) && isset($record[$this->name . 'Amount'])) {
|
||||||
if($record[$this->name . 'Currency'] && $record[$this->name . 'Amount']) {
|
if($record[$this->name . 'Currency'] && $record[$this->name . 'Amount']) {
|
||||||
|
Loading…
Reference in New Issue
Block a user