add searchpattern
This commit is contained in:
@@ -26,6 +26,12 @@ class PisApi extends Api {
|
||||
*/
|
||||
public static $routeParameterINames = "/iname/:iname+";
|
||||
|
||||
/**
|
||||
* public string for the patter string parameter
|
||||
* @var string
|
||||
*/
|
||||
public static $routParameterIPatter = "ipatter/:ipatter";
|
||||
|
||||
/**
|
||||
* Keyword for pidList arguments
|
||||
* @var string
|
||||
@@ -38,6 +44,12 @@ class PisApi extends Api {
|
||||
*/
|
||||
public static $keyINameList = "iNameList";
|
||||
|
||||
/**
|
||||
* Keyword for iNameList arguments
|
||||
* @var string
|
||||
*/
|
||||
public static $keyIPatter = "searchPatter";
|
||||
|
||||
/**
|
||||
* max number of pid for each query
|
||||
* @var int
|
||||
@@ -66,22 +78,27 @@ class PisApi extends Api {
|
||||
* @return query result as xml
|
||||
*/
|
||||
public function sendPisQuery($queryArgs) {
|
||||
$pidList = \utiliy\ArrayManager::removeEmptyItmes($queryArgs[self::$keyPidList]);
|
||||
|
||||
$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 (array_key_exists(self::$keyIPatter, $queryArgs)) {
|
||||
$iPatter = trim($queryArgs[self::$keyIPatter]);
|
||||
} else {
|
||||
$iPatter = "*";
|
||||
}
|
||||
|
||||
if (count($pidList) < self::$maxPid) {
|
||||
$result = $this->sqlManager->sendPisQuery($pidList, $iNameList);
|
||||
$result = $this->sqlManager->sendPisQuery($pidList, $iNameList,$iPatter);
|
||||
|
||||
return $this->serialManager->arrayToPis($result);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user