--- a/getAgency.php +++ b/getAgency.php @@ -47,10 +47,19 @@ } function addDefaultFields($row) { - $defaultFields = Array("name"); + global $schemas; + $defaultFields = array_keys($schemas['agency']['properties']); foreach ($defaultFields as $defaultField) { - if (!isset($row[$defaultField])) + if (!isset($row[$defaultField])) { + if ($schemas['agency']['properties'][$defaultField]['type'] == "string") { + $row[$defaultField] = ""; + } + if ($schemas['agency']['properties'][$defaultField]['type'] == "array") { + + $row[$defaultField] = Array(""); + } + } } return $row; } @@ -119,12 +128,20 @@ } else { try { - $rows = $db->get_view("app", "showNamesABNs")->rows; + /*$rows = $db->get_view("app", "showNamesABNs")->rows; //print_r($rows); foreach ($rows as $row) { // print_r($row); echo '