public static function flattenArray($array, $delimiter = '.', $prefix = '') {
        if(!is_array($array)) {
            return $array;
        }

        $result = array();

        foreach($array as $key => $value) {
            if(is_array($value)) {
                $result = array_merge($result, self::flattenArray($value, $delimiter, $prefix.$key.$delimiter));
            }
            else {
                $result[$prefix.$key] = $value;
            }
        }

        return $result;
    }