Overview

Namespaces

  • api
  • config
  • database
  • PHP
  • Slim
    • Exception
    • Http
    • Middleware
  • utiliy

Classes

  • ArrayManager
  • StringManager
  • XmlManager
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: namespace utiliy;
 4: 
 5: include_once "../../global.inc.php";
 6: include_once PATH_UTILITTY . "/StringManager.php";
 7: 
 8: /**
 9:  * The ArrayManager provides some array-methods
10:  * @author stubbfel
11:  * @since 26.06.2013
12:  */
13: class ArrayManager {
14: 
15:     /**
16:      * Method remove all empty itmes of an array
17:      * @param array $queryArgs
18:      * @return array
19:      */
20:     public static function removeEmptyItmes($array) {
21:         foreach ($array as $key => $value) {
22:             if (empty($value)) {
23:                 unset($array[$key]);
24:             }
25:         }
26:         return $array;
27:     }
28: 
29:     /**
30:      * Method convert an array to a where-string like $fieldname = $array[i] $operator
31:      * @param array $pidList
32:      * @return string
33:      */
34:     public static function toSqlWhereString($array, $operator = "", $fieldname = "") {
35:         $arrayStr = StringManager::$emptyString;
36:         foreach ($array as $value) {
37:             $arrayStr .= $fieldname . $value . $operator;
38:         }
39:         $result = substr($arrayStr, 0, strlen($arrayStr) - strlen($operator));
40:         return $result;
41:     }
42: 
43:     /**
44:      * Method check if  all items of the array are only digits and < PHP_INT_MAX
45:      * @param array $poly
46:      * @return boolean
47:      */
48:     public static function validIntList($list) {
49:         foreach ($list as $value) {
50: 
51:             if (!ctype_digit($value) || PHP_INT_MAX < $value) {
52:                 return FALSE;
53:             }
54:         }
55:         return TRUE;
56:     }
57: 
58: }
59: 
60: ?>
61: 
GeoApi API documentation generated by ApiGen 2.8.0