Hello
I'm trying to add some custom Fields to a Output generated by the Controller. I tried something like this:
$set = DataObject::get( ... );
return $set->customise( array( 'CustomField' => $myValue ));
This doesn't seem to work though. If i do that, it doesn't preserve the values i got from the DB via DataObject::get().
If i do a foreach loop over the Set and customize every DataObject, it doesn't append the new values:
$set = DataObject::get( ... );
foreach($set as $item){
$item = $item->customise(array('CustomField' => $myValue));
}
return $set;
What is the right syntax to customise every DataObject in a DataObjectSet?
Input is much appreciated. Thanks