code: public function createMetadata(array $relations, ObjectIdentifier $identifier)
      {
          $metadata = new Metadata($identifier);
  
          foreach ($relations as $field => $relation) {
              $metadata->setRelation($this->createRelation($field, $relation));
          }
  
          return $metadata;
      }
docs: @param array            $relations
  @param ObjectIdentifier $identifier
  
  @return Metadata