code: private function getOrmMappingDriverChainDefinition(Container $container): callable
      {
          return $container->protect(function (Configuration $config, array $mappings) use ($container) {
              $chain = new MappingDriverChain();
              foreach ($mappings as $mapping) {
                  if (isset($mapping['alias'])) {
                      $config->addEntityNamespace($mapping['alias'], $mapping['namespace']);
                  }
  
                  $factoryKey = sprintf('doctrine.orm.mapping_driver.factory.%s', $mapping['type']);
  
                  $chain->addDriver($container[$factoryKey]($mapping, $config), $mapping['namespace']);
              }
  
              return $chain;
          });
      }
docs: @param Container $container
  
  @return callable