private function _merge_values($data, $values, $columns)
    {
        foreach ($values as $key => $value) {
            if (!is_numeric($key) && $key != '[]') {
                if (isset($columns[$key])) {
                    $type = strtolower($columns[$key]);
                    if ($value === null) {
                        $type = 'null';
                    }
                    switch ($type) {
                        case 'int':
                        case 'int4':
                        case 'tiny':
                        case 'long':
                        case 'integer':
                            $value = intval($value);
                        break;
                        case 'bool':
                        case 'boolean':
                            $value = (bool) $value;
                        break;
                        case 'float':
                        case 'double':
                            $value = floatval($value);
                        break;
                        case 'null':
                            $value = null;
                        break;
                        default:
                            $value = utf8_encode($value);
                        break;
                    }
                }

                if ($data instanceof DataInterface) {
                    $data->set($key, $value);
                } elseif (is_array($data)) {
                    $data[$key] = $value;
                }
            }
        }

        return $data;
    }