// Get all map data from database
$maps = R::findAll('map');
// Format as json array
$data = '{}';
if(!empty($maps))
{
$array = [];
foreach( $maps as $m )
{
$array[] = $m->export( false, false, true );
}
$data = json_encode($array);
}
From what I see in the method prototype and code, without that true on the 3rd parameter to export(), it will still export the contents of ->ownDeviceList, which is what I was trying to suppress.
It would be nice to have that parameter accessible from exportAll(), to save code lines if nothing else.
Also, I'm a big fan of passing optional parameters via arrays or generic objects, in order to avoid ugly call lines like the one above.
Dennis