This commit is contained in:
stubbfel
2013-06-26 14:00:16 +02:00
parent 27604f0c3f
commit 34c0549ac8
12 changed files with 338 additions and 98 deletions

View File

@@ -5,6 +5,7 @@ namespace api;
include_once "../../global.inc.php";
include_once PATH_DATABASE . "/PisSqlManager.php";
include_once PATH_UTILITTY . "/XmlManager.php";
include_once PATH_UTILITTY . "/ArrayManager.php";
require_once PATH_API . "/Api.php";
/**
@@ -47,28 +48,13 @@ class PisApi extends Api {
* @return query result as xml
*/
public function sendPisQuery($queryArgs) {
$pidList = $this->removeEmptyItmes($queryArgs);
$pidList = \utiliy\ArrayManager::removeEmptyItmes($queryArgs);
if (count($pidList) < $this->maxPid) {
$result = $this->sqlManager->sendPisQuery($pidList);
return \utiliy\XmlManager::arrayToPisXml($result);
}
return NULL;
}
/**
* Method remove all empty string
* @param array $queryArgs
* @return array
*/
private function removeEmptyItmes($queryArgs) {
foreach ($queryArgs as $key => $value) {
if (empty($value)) {
unset($queryArgs[$key]);
}
}
return $queryArgs;
}
}
?>