5415 Posts in 1651 Topics by 1188 members
|Go to End|
13 December 2013 at 11:05am
My DataObject has one Image.
I want to display the DataObject in JSON. In addition, I want to add the Image.Filename to the JSON Array.
$query = "SELECT * FROM Object LEFT JOIN File ON Object.ImageID = File.ID";
$records = DB::query($query);
I guess that the $records object is no DataObjectSet, so JSON does not work. Although it works when doing DataObject::get("Object)!
Could you please tell me how to convert the $records object to JSON? (Or is there a better way of doing this?)
|Go to Top|