61 lines
1.3 KiB
PHP
61 lines
1.3 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 $maxPid = 10;
|
|
|
|
/**
|
|
* Default-Constructor
|
|
*/
|
|
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) < $this->maxPid) {
|
|
$result = $this->sqlManager->sendPisQuery($pidList);
|
|
|
|
return $this->serialManager->arrayToPis($result);
|
|
}
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
?>
|