// Get all data $filter = new Filter(DATARECORD CLASS NAME); $collection = $filter->execute(); $result = Table::getDataFromCollection($collection); header('Content-type: text/json'); echo json_encode($result);