public static function fromMetadata(string $metadata): ? array
    {
        $values = [];
        $splittedParts = explode('~~', $metadata);

        foreach ($splittedParts as $part) {
            $parts = explode('##', $part);
            if (count($parts) > 1) {
                $values[$parts[0]] = $parts[1];
            } else {
                $values[] = $part;
            }
        }

        if (1 == count($values)) {
            $firstAndUniqueElement = reset($values);
            $values = [
                'id' => $firstAndUniqueElement,
                'name' => $firstAndUniqueElement,
            ];
        }

        if (!array_key_exists('id', $values)) {
            return null;
        }

        return $values;
    }