1: <?php
2:
3: namespace api;
4:
5: include_once "../../global.inc.php";
6: include_once PATH_DATABASE . "/PssSqlManager.php";
7: include_once PATH_UTILITTY . "/XmlManager.php";
8: include_once PATH_UTILITTY . "/ArrayManager.php";
9: require_once PATH_API . "/Api.php";
10:
11: /**
12: * This class provides some spezial PssAPI methods
13: * @author stubbfel
14: * @since 20.06.2013
15: */
16: class PssApi extends Api {
17:
18: /**
19: * Route string for the alias paramter
20: * @var string
21: */
22: public static $routeParameterPids = "/pid/:pid+";
23:
24: /**
25: * max number of pid for each query
26: * @var int
27: */
28: private $maxPid = 10;
29:
30: /**
31: * Default-Constructor
32: */
33: public function __construct() {
34: $this->sqlManager = new \database\PssSqlManager();
35: parent::__construct();
36: }
37:
38: /**
39: * Default-DeConstructor
40: */
41: public function __destruct() {
42: parent::__destruct();
43: }
44:
45: /**
46: * Method start a pis-query
47: * @param array $queryArgs
48: * @return query result as xml
49: */
50: public function sendPssQuery($queryArgs) {
51: $pidList = \utiliy\ArrayManager::removeEmptyItmes($queryArgs);
52:
53: if (count($pidList) < $this->maxPid) {
54: $result = $this->sqlManager->sendPssQuery($pidList);
55: return \utiliy\XmlManager::arrayToPssXml($result);
56: }
57: return NULL;
58: }
59:
60: }
61:
62: ?>
63: