This commit is contained in:
stubbfel
2013-07-10 11:34:07 +02:00
parent 5c11441ef5
commit fe6e6eaaf4
7 changed files with 163 additions and 67 deletions

View File

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