private function addDetectedMappingNodes(
        ArrayNodeDefinition $rootNode,
        MappingBagCollection $mappingBagCollection
    ) {
        $mappingNode = $rootNode
            ->children()
            ->arrayNode('mapping')
            ->addDefaultsIfNotSet()
            ->children();

        foreach ($mappingBagCollection->all() as $mappingBag) {
            if ($mappingBag->isOverwritable()) {
                $mappingNode->append($this->addMappingNode(
                    $mappingBag->getEntityName(),
                    $mappingBag->getEntityNamespace(),
                    $mappingBag->getEntityMappingFilePath(),
                    $mappingBag->getManagerName(),
                    $mappingBag->getEntityIsEnabled()
                ));
            }
        }
    }