code: private function loadMetadata($doc, $content)
      {
          $class = $this->config->getMetadataClass();
          /* @var $metadata MetadataInterface */
          $metadata = new $class();
  
          $metadatas = get_object_vars(json_decode($content));
          foreach ($metadatas as $name => $value) {
              $metadata->add($name, $value);
          }
          $doc->setMetadata($metadata);
      }
docs: load Metadata
  @param Document $doc
  @param string $content