public function getMappings(array $bundles)
    {
        $output = [];
        foreach ($bundles as $name => $bundleConfig) {
            // Backward compatibility hack for support.
            if (!is_array($bundleConfig)) {
                $name = $bundleConfig;
                $bundleConfig = [];
            }
            $mappings = $this->getBundleMapping($name, $bundleConfig);

            $alreadyDefinedTypes = array_intersect_key($mappings, $output);
            if (count($alreadyDefinedTypes)) {
                throw new \LogicException(
                    implode(',', array_keys($alreadyDefinedTypes)) .
                    ' type(s) already defined in other document, you can use the same ' .
                    'type only once in a manager definition.'
                );
            }

            $output = array_merge($output, $mappings);
        }

        return $output;
    }