code: private function addMappings(ClassMetadata $metadata, array $mappings)
      {
          foreach ($mappings as $mapping) {
              if (!$metadata->hasField($mapping['fieldName'])) {
                  $metadata->mapField($mapping);
              }
          }
      }
docs: Adds the mappings to the metadata.
  
  @param ClassMetadata $metadata
  @param array         $mappings