ad parent paramter to pis

This commit is contained in:
stubbfel
2013-10-16 11:16:46 +02:00
parent 4494bf9c5c
commit 9f263bc454
5 changed files with 70 additions and 11 deletions

View File

@@ -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;
}
}
?>