1: <?php
2:
3: namespace database;
4:
5: include_once "../../global.inc.php";
6: include_once PATH_UTILITTY . "/ArrayManager.php";
7: require_once PATH_DATABASE . "/SqlManager.php";
8:
9: /**
10: * Description of PssSqlManager
11: *
12: * @author stubbfel
13: * @since 20.06.2013
14: */
15: class PssSqlManager extends SQLManager {
16:
17: /**
18: * Fieldname of the placeID
19: * @var string
20: */
21: public static $placeId = "pid";
22:
23: /**
24: * Fieldname of the name of the service
25: * @var string
26: */
27: public static $srvName = "sName";
28:
29: /**
30: * Fieldname of the value of the information
31: * @var string
32: */
33: public static $srvSap = "sap";
34:
35: /**
36: * Fieldname of the value of the information
37: * @var string
38: */
39: public static $srvRequest = "request";
40:
41: /**
42: * String for the select part of the query
43: * @var string
44: */
45: private $selectTerm = "SELECT pid, sName, sap, request FROM pss WHERE ";
46:
47: /**
48: * String for the orderby part of the query
49: * @var string
50: */
51: private $orderByTerm = " ORDER BY pid, sName";
52:
53: /**
54: * String for the pid part of the query
55: * @var string
56: */
57: private $pidTerm = "pid = ";
58:
59: /**
60: * Default-Constructor
61: */
62: public function __construct() {
63: parent::__construct();
64: }
65:
66: /**
67: * Default-DeConstructor
68: */
69: public function __destruct() {
70: parent::__destruct();
71: }
72:
73: /**
74: * Methods send an query for the pis-service
75: * @param array $queryArgs
76: * @return array [num][assoc]
77: */
78: public function sendPssQuery($queryArgs) {
79:
80: // build query string
81: $query = $this->selectTerm;
82:
83: if (\utiliy\ArrayManager::validIntList($queryArgs)) {
84: $query .= \utiliy\ArrayManager::toSqlWhereString($queryArgs, $this->orTerm, $this->pidTerm) . $this->orderByTerm;
85: } else {
86: return null;
87: };
88:
89: // send query
90: return $this->query($query);
91: }
92:
93: }
94:
95: ?>
96: