I have the following code:
$data = DataObject::get('Property',"SoftDelete=0 AND Bedrooms >= ".$minBeds." AND Price<='". $maxPrice."'","Price ASC");
$f1 = new JSONDataFormatter();
return $f1->convertDataObjectSet($data);
However the response is:
{"totalSize":null,"items":[]}
There are definitely records in the DataObject, as if I do:
$data = DataObject::get('Property',"SoftDelete=0 AND Bedrooms >= ".$minBeds." AND Price<='". $maxPrice."'","Price ASC");
foreach($data as $dataobj){
print_r($data);
}
I can see the data for all the records.