This commit is contained in:
stubbfel
2013-07-10 12:48:18 +02:00
parent fe6e6eaaf4
commit 2d9523c80e
3 changed files with 60 additions and 10 deletions

View File

@@ -20,6 +20,24 @@ class PssApi extends Api {
* @var string
*/
public static $routeParameterPids = "/pid/:pid+";
/**
* Route string for the iNames paramter
* @var string
*/
public static $routeParameterSNames = "/sname/:sname+";
/**
* Keyword for pidList arguments
* @var string
*/
public static $keyPidList = "pidList";
/**
* Keyword for iNameList arguments
* @var string
*/
public static $keySNameList = "sNameList";
/**
* max number of pid for each query
@@ -49,11 +67,18 @@ class PssApi extends Api {
* @return query result as xml
*/
public function sendPssQuery($queryArgs) {
$pidList = \utiliy\ArrayManager::removeEmptyItmes($queryArgs);
$pidList = \utiliy\ArrayManager::removeEmptyItmes($queryArgs[self::$keyPidList]);
if (array_key_exists(self::$keySNameList, $queryArgs)) {
$sNameList = \utiliy\ArrayManager::removeEmptyItmes($queryArgs[self::$keySNameList]);
} else {
$sNameList = array();
}
if (count($pidList) < self::$maxPid) {
$result = $this->sqlManager->sendPssQuery($pidList);
return $this->serialManager->arrayTopis($result);
$result = $this->sqlManager->sendPssQuery($pidList, $sNameList);
return $this->serialManager->arrayToPss($result);
}
return NULL;
}