code: public function createMetadata(ClassMetadata $doctrineMetadata, ObjectIdentifier $identifier)
      {
          $metadata = new Metadata($identifier);
  
          foreach ($doctrineMetadata->associationMappings as $association) {
              if ($this->isToOneRelation($association)) {
                  $metadata->setRelation(new OneToOneRelation($association['fieldName']));
              } elseif ($this->isToManyRelation($association)) {
                  $metadata->setRelation(new OneToManyRelation($association['fieldName']));
              }
          }
  
          return $metadata;
      }
docs: @param ClassMetadata    $doctrineMetadata
  @param ObjectIdentifier $identifier
  
  @return Metadata