add pss #62
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user