selectTerm; if ($this->validPidList($queryArgs)) { $query .= $this->createPidWhereString($queryArgs) . $this->orderByTerm; } else { return null; } // send query return $this->query($query); } /** * Method check if all items of the pidlist are orly digits * @param array $poly * @return boolean */ private function validPidList($pidList) { foreach ($pidList as $value) { if (!ctype_digit($value) || PHP_INT_MAX < $value) { return FALSE; } } return TRUE; } /** * Method convert a pidList to a where-string * @param array $pidList * @return string */ private function createPidWhereString($pidList) { $pidListStr = \utiliy\StringManager::$emptyString; foreach ($pidList as $value) { $pidListStr .= $this->pidTerm . $value . $this->orTerm; } $result = substr($pidListStr, 0, strlen($pidListStr) - strlen($this->orTerm)); return $result; } } ?>