finish #70
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user