private function resolveEntityMapping(
        ContainerBuilder $container,
        string $entityManagerName,
        string $entityNamespace,
        string $entityMappingFilePath,
        $enable = true
    ) : ? EntityMapping {
        $enableEntityMapping = $this->resolveParameterName(
            $container,
            $enable
        );

        if (false === $enableEntityMapping) {
            return null;
        }

        $entityNamespace = $this->resolveParameterName($container, $entityNamespace);

        if (!class_exists($entityNamespace)) {
            throw new ConfigurationInvalidException('Entity ' . $entityNamespace . ' not found');
        }

        $entityMappingFilePath = $this->resolveParameterName($container, $entityMappingFilePath);
        $entityManagerName = $this->resolveParameterName($container, $entityManagerName);
        $this->resolveEntityManagerName($container, $entityManagerName);

        return new EntityMapping(
            $entityNamespace,
            $entityMappingFilePath,
            $entityManagerName
        );
    }