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:
Ingo Schommer 2009-05-12 05:29:59 +00:00
parent 2b042be1ff
commit 4085b3e654

View File

@ -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'])) {