add pss #62
This commit is contained in:
95
geoapi/database/PssSqlManager.php
Normal file
95
geoapi/database/PssSqlManager.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace database;
|
||||
|
||||
include_once "../../global.inc.php";
|
||||
include_once PATH_UTILITTY . "/ArrayManager.php";
|
||||
require_once PATH_DATABASE . "/SqlManager.php";
|
||||
|
||||
/**
|
||||
* Description of ZisSqlManager
|
||||
*
|
||||
* @author stubbfel
|
||||
* @since 20.06.2013
|
||||
*/
|
||||
class PssSqlManager extends SQLManager {
|
||||
|
||||
/**
|
||||
* Fieldname of the placeID
|
||||
* @var string
|
||||
*/
|
||||
public static $placeId = "pid";
|
||||
|
||||
/**
|
||||
* Fieldname of the name of the service
|
||||
* @var string
|
||||
*/
|
||||
public static $srvName = "sName";
|
||||
|
||||
/**
|
||||
* Fieldname of the value of the information
|
||||
* @var string
|
||||
*/
|
||||
public static $srvSap = "sap";
|
||||
|
||||
/**
|
||||
* Fieldname of the value of the information
|
||||
* @var string
|
||||
*/
|
||||
public static $srvRequest = "request";
|
||||
|
||||
/**
|
||||
* String for the select part of the query
|
||||
* @var string
|
||||
*/
|
||||
private $selectTerm = "SELECT pid, sName, sap, request FROM pss WHERE ";
|
||||
|
||||
/**
|
||||
* String for the orderby part of the query
|
||||
* @var string
|
||||
*/
|
||||
private $orderByTerm = " ORDER BY pid, sName";
|
||||
|
||||
/**
|
||||
* String for the pid part of the query
|
||||
* @var string
|
||||
*/
|
||||
private $pidTerm = "pid = ";
|
||||
|
||||
/**
|
||||
* Default-Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Default-DEConstructor
|
||||
*/
|
||||
public function __destruct() {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Methods send an query for the pis-service
|
||||
* @param array $queryArgs
|
||||
* @return array [num][assoc]
|
||||
*/
|
||||
public function sendPssQuery($queryArgs) {
|
||||
|
||||
// build query string
|
||||
$query = $this->selectTerm;
|
||||
|
||||
if (\utiliy\ArrayManager::validIntList($queryArgs)) {
|
||||
$query .= \utiliy\ArrayManager::toSqlWhereString($queryArgs, $this->orTerm, $this->pidTerm) . $this->orderByTerm;
|
||||
} else {
|
||||
return null;
|
||||
};
|
||||
|
||||
// send query
|
||||
return $this->query($query);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user