Overview

Namespaces

  • api
  • config
  • database
  • None
  • PHP
  • Slim
    • Exception
    • Http
    • Middleware
  • utiliy

Classes

  • PisSqlManager
  • PssSqlManager
  • SpsSqlManager
  • SqlManager
  • Overview
  • Namespace
  • Class
  • Tree
  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:      * Fieldname of the parendId
 43:      * @var string
 44:      */
 45:     public static $parentId = "parent";
 46: 
 47:     /**
 48:      * Fieldname of the refpoint
 49:      * @var string
 50:      */
 51:     public static $refpoint = "refpoint";
 52: 
 53:     /**
 54:      * String for the select part of the query
 55:      * @var string
 56:      */
 57:     private static $selectTerm = "SELECT pid, parent, refpoint, sName, sap, request FROM pss WHERE ";
 58: 
 59:     /**
 60:      * String for the select all part of the query
 61:      * @var string
 62:      */
 63:     private static $selectAllTerm = "SELECT pid, parent, refpoint, sName, sap, request FROM pss ";
 64: 
 65:     /**
 66:      * String for the orderby part of the query
 67:      * @var string
 68:      */
 69:     private static $orderByTerm = " ORDER BY pid, sName";
 70: 
 71:     /**
 72:      * String for the pid part of the query
 73:      * @var string
 74:      */
 75:     private static $pidTerm = "pid = ";
 76: 
 77:     /**
 78:      * String for the iName part of the query
 79:      * @var string
 80:      */
 81:     private static $sNameTerm = "sName = ";
 82: 
 83:     /**
 84:      * Default-Constructor
 85:      */
 86:     public function __construct() {
 87:         parent::__construct();
 88:     }
 89: 
 90:     /**
 91:      * Default-DeConstructor
 92:      */
 93:     public function __destruct() {
 94:         parent::__destruct();
 95:     }
 96: 
 97:     /**
 98:      * Methods send an query for the pis-service
 99:      * @param array $queryArgs
100:      * @return array [num][assoc]
101:      */
102:     public function sendPssQuery($pidList, $sNameList) {
103: 
104:         // build query string
105:         $query = self::$selectTerm;
106:         if (\utiliy\ArrayManager::validIntList($pidList)) {
107:             $query .= self::$openBracket;
108:             $query .= \utiliy\ArrayManager::toSqlWhereString($pidList, self::$orTerm, self::$pidTerm);
109:             $query .= self::$closeBracket;
110:         } else if ($pidList[0] != "*") {
111:             return null;
112:         }
113: 
114:         if (count($sNameList) > 0 && \utiliy\ArrayManager::validAlphaNumList($sNameList)) {
115:             if ($query != self::$selectTerm) {
116:                 $query .= self::$andTerm;
117:             }
118:             $query .= self::$openBracket;
119:             $query .= \utiliy\ArrayManager::toSqlWhereString($sNameList, self::$orTerm, self::$sNameTerm);
120:             $query .= self::$closeBracket;
121:         }
122: 
123:         if ($query == self::$selectTerm) {
124:             $query = self::$selectAllTerm;
125:         }
126: 
127:         $query .= self::$orderByTerm;
128: 
129:         // send query
130:         return $this->query($query);
131:     }
132: 
133: }
134: 
135: ?>
136: 
GeoApi API documentation generated by ApiGen 2.8.0