public function matchTypes($columns, $types)
    {
        if (!is_int(key($types))) {
            $positions = array_intersect_key(array_flip($columns), $types);
            $types = array_intersect_key($types, $positions);
            $types = array_combine($positions, $types);
        }

        return $types;
    }
public function matchTypes($columns, $types)
    {
        if (!is_int(key($types))) {
            $positions = array_intersect_key(array_flip($columns), $types);
            $types = array_intersect_key($types, $positions);
            $types = array_combine($positions, $types);
        }

        return $types;
    }
public function matchTypes ( $ columns , $ types ) { if ( ! is_int ( key ( $ types ) ) ) { $ positions = array_intersect_key ( array_flip ( $ columns ) , $ types ) ; $ types = array_intersect_key ( $ types , $ positions ) ; $ types = array_combine ( $ positions , $ types ) ; } return $ types ; }
Matches columns to corresponding types

Both $columns and $types should either be numeric based or string key based at
the same time.

@param array $columns list or associative array of columns and parameters to be bound with types
@param array $types list or associative array of types
@return array
Matches columns to corresponding types