Files
geodb/geoapi/api/PisApi.php
2013-07-01 18:54:59 +02:00

62 lines
1.4 KiB
PHP

<?php
namespace api;
include_once "../../global.inc.php";
include_once PATH_DATABASE . "/PisSqlManager.php";
include_once PATH_UTILITTY . "/ArrayManager.php";
require_once PATH_API . "/Api.php";
/**
* This class provides some spezial PisAPI methods
* @author stubbfel
* @since 20.06.2013
*/
class PisApi extends Api {
/**
* Route string for the alias paramter
* @var string
*/
public static $routeParameterPids = "/pid/:pid+";
/**
* max number of pid for each query
* @var int
*/
private static $maxPid = 10;
/**
* Constructor
* @param array[assoc] $headers - RequestHeader
*/
public function __construct($headers = array()) {
$this->sqlManager = new \database\PisSqlManager();
parent::__construct($headers);
}
/**
* Default-DeConstructor
*/
public function __destruct() {
parent::__destruct();
}
/**
* Method start a pis-query
* @param array $queryArgs
* @return query result as xml
*/
public function sendPisQuery($queryArgs) {
$pidList = \utiliy\ArrayManager::removeEmptyItmes($queryArgs);
if (count($pidList) < self::$maxPid) {
$result = $this->sqlManager->sendPisQuery($pidList);
return $this->serialManager->arrayToPis($result);
}
return NULL;
}
}
?>