$row[\database\SpsSqlManager::$parentId], self::$refpointName => $row[\database\SpsSqlManager::$refpoint]); $places[$row[\database\SpsSqlManager::$placeId]] = $place; } return json_encode($places); } /** * Method convert an array to a response json for the pis service like * @example [{"id":"127003463","0":{"placeInformationName":"name","placeInformationValue":"Informations-, Kommunikations- und Medienzentrum"},"1":{"placeInformationName":"typ","placeInformationValue":"library"}}] * @param array[num][assoc] $result * @return json-string */ public static function arrayToPisJson($result) { $infos = array(); foreach ($result as $row) { // fetch the place id of the row $placeId = $row[\database\PisSqlManager::$placeId]; $infos[$placeId][$row[\database\PisSqlManager::$infName]] = utf8_encode($row[\database\PisSqlManager::$infValue]); } return json_encode($infos); } /** * Method convert an array to a response json for the pss service * @example {"1":{"website":{"sap":"http:\/\/www.","request":"tu-cottbus.de\/btu\/"}},"2":{"website":{"sap":"http:\/\/www.","request":"hs-lausitz.de\/start.html"}}} * @param array[num][assoc] $result * @return Json-string */ public static function arrayToPssJson($result) { $services = array(); foreach ($result as $row) { // fetch the place id of the row $placeId = $row[\database\PssSqlManager::$placeId]; $placeSrv = array(self::$placeSapName => $row[\database\PssSqlManager::$srvSap], self::$placeRequestName => $row[\database\PssSqlManager::$srvRequest]); $services[$placeId][$row[\database\PssSqlManager::$srvName]] = $placeSrv; } return json_encode($services); } /** * Implement the arrayToSps from @see SerialManager * @param array [num] [assoc] $result * @return string */ public function arrayToSps($result) { return self::arrayToSpsJson($result); } /** * Implement the arrayToPss from @see SerialManager * @param array [num] [assoc] $result * @return string */ public function arrayToPss($result) { return self::arrayToPssJson($result); } /** * Implement the arrayToPis from @see SerialManager * @param array [num] [assoc] $result * @return string */ public function arrayToPis($result) { return self::arrayToPisJson($result); } } ?>