finish #69
This commit is contained in:
@@ -15,11 +15,29 @@ require_once PATH_API . "/Api.php";
|
||||
class PisApi extends Api {
|
||||
|
||||
/**
|
||||
* Route string for the alias paramter
|
||||
* Route string for the pids paramter
|
||||
* @var string
|
||||
*/
|
||||
public static $routeParameterPids = "/pid/:pid+";
|
||||
|
||||
/**
|
||||
* Route string for the iNames paramter
|
||||
* @var string
|
||||
*/
|
||||
public static $routeParameterINames = "/iname/:iname+";
|
||||
|
||||
/**
|
||||
* Keyword for pidList arguments
|
||||
* @var string
|
||||
*/
|
||||
public static $keyPidList = "pidList";
|
||||
|
||||
/**
|
||||
* Keyword for iNameList arguments
|
||||
* @var string
|
||||
*/
|
||||
public static $keyINameList = "iNameList";
|
||||
|
||||
/**
|
||||
* max number of pid for each query
|
||||
* @var int
|
||||
@@ -48,14 +66,22 @@ class PisApi extends Api {
|
||||
* @return query result as xml
|
||||
*/
|
||||
public function sendPisQuery($queryArgs) {
|
||||
$pidList = \utiliy\ArrayManager::removeEmptyItmes($queryArgs);
|
||||
$pidList = \utiliy\ArrayManager::removeEmptyItmes($queryArgs[self::$keyPidList]);
|
||||
|
||||
if (array_key_exists(self::$keyINameList, $queryArgs)) {
|
||||
$iNameList = \utiliy\ArrayManager::removeEmptyItmes($queryArgs[self::$keyINameList]);
|
||||
} else {
|
||||
$iNameList = array();
|
||||
}
|
||||
|
||||
if (count($pidList) < self::$maxPid) {
|
||||
$result = $this->sqlManager->sendPisQuery($pidList);
|
||||
|
||||
$result = $this->sqlManager->sendPisQuery($pidList, $iNameList);
|
||||
|
||||
return $this->serialManager->arrayToPis($result);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user