ad parent paramter to pis
This commit is contained in:
@@ -19,6 +19,12 @@ class PisApi extends Api {
|
||||
* @var string
|
||||
*/
|
||||
public static $routeParameterPids = "/pid/:pid+";
|
||||
|
||||
/**
|
||||
* Route string for the parent paramter
|
||||
* @var string
|
||||
*/
|
||||
public static $routeParameterParent = "/parent/:parent";
|
||||
|
||||
/**
|
||||
* Route string for the iNames paramter
|
||||
@@ -50,6 +56,12 @@ class PisApi extends Api {
|
||||
*/
|
||||
public static $keyIPatter = "searchPatter";
|
||||
|
||||
/**
|
||||
* Keyword for parendId arguments
|
||||
* @var string
|
||||
*/
|
||||
public static $keyParentId = "parendId";
|
||||
|
||||
/**
|
||||
* max number of pid for each query
|
||||
* @var int
|
||||
@@ -85,20 +97,26 @@ class PisApi extends Api {
|
||||
} else {
|
||||
$iNameList = array();
|
||||
}
|
||||
|
||||
if (array_key_exists(self::$keyIPatter, $queryArgs)) {
|
||||
$iPatter = trim($queryArgs[self::$keyIPatter]);
|
||||
} else {
|
||||
$iPatter = "*";
|
||||
}
|
||||
|
||||
if (array_key_exists(self::$keyParentId, $queryArgs)) {
|
||||
$parentId = trim($queryArgs[self::$keyParentId]);
|
||||
} else {
|
||||
$parentId = "*";
|
||||
}
|
||||
|
||||
if (count($pidList) < self::$maxPid) {
|
||||
$result = $this->sqlManager->sendPisQuery($pidList, $iNameList,$iPatter);
|
||||
$result = $this->sqlManager->sendPisQuery($pidList, $parentId, $iNameList, $iPatter);
|
||||
|
||||
return $this->serialManager->arrayToPis($result);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user