public static function flatten(array $set, $path = null) {
        if ($path) {
            $path = $path . '.';
        }

        $data = array();

        foreach ($set as $key => $value) {
            if (is_array($value)) {
                if ($value) {
                    $data += static::flatten($value, $path . $key);
                } else {
                    $data[$path . $key] = null;
                }
            } else {
                $data[$path . $key] = $value;
            }
        }

        return $data;
    }