private function getManagerName(ContainerBuilder $container)
    {
        foreach ($this->managerParameters as $param) {
            if ($container->hasParameter($param)) {
                $name = $container->getParameter($param);
                if ($name) {
                    return $name;
                }
            }
        }

        throw new InvalidArgumentException(sprintf(
            'Could not find the manager name parameter in the container. Tried the following parameter names: "%s"',
            implode('", "', $this->managerParameters)
        ));
    }