Get registered builder's manager.

@param string $name

@throws \RuntimeException

@return \Doctrine\Common\Persistence\ObjectManager
517340
public function getManager($name)
    {
        $builder = $this->getBuilder($name);
        if (!$builder instanceof Builder) {
            throw new \RuntimeException(sprintf('"%s" is not a registered manager', $name));
        }

        $manager = $builder->getManager();

        $this->registerGlobalAnnotationLoader();

        return $manager;
    }
1347824
protected function getService($name)
	{
		if (!isset($this->container[$name])) {
			throw new \Exception(sprintf('There is no service (connection or entity manager) with id "%s"', $name));
		}

		return $this->container[$name];
	}
582362
static public function get($apiManager, $name)
	{
		if(!array_key_exists($name,self::$managerMap)){
            throw new \InvalidArgumentException('Error in Factory Manager. This manager ['.$name.']is not supported');
        }
        $className = self::$managerMap[$name];
        return self::factory($apiManager, $className);
	}
356210
public function findOneByName($name)
    {
        $entityClass = $this->getEntityClass();

        return $this->getObjectManager()
                    ->getRepository($entityClass)
                    ->findOneByName($name);
    }
1244060
public function getHandler($name) {
        if (!isset($this->instances[$name])) {
            $handlerClass = __NAMESPACE__ . '\\' . $name;
            $this->instances[$name] = new $handlerClass($this->builder);
        }
        return $this->instances[$name];
    }
406539
private function loadMenu($name)
    {
        if ($name instanceof Menu) {
            return $name;
        }

        $menu = $this->menuRepository->findOneBy(array('name' => $name));

        if (!$menu) {
            throw new \RuntimeException(sprintf('Unable to load menu "%s"', $name));
        }

        return $menu;
    }
514225
public function get($name)
    {
        if (isset($this->instances[$name])) {
            return $this->instances[$name];
        }
        if (! isset($this->registry[$name])) {
            $exceptionClass = static::NOT_FOUND_EXCEPTION;
            throw new $exceptionClass(
                sprintf(static::NOT_FOUND_MESSAGE, $name)
            );
        }
        try {
            $this->instances[$name] = $this->build($this->registry[$name], $name);
        } catch (Exception $e) {
            throw new RuntimeException(
                sprintf(static::BUILD_FAILURE_MESSAGE, $name),
                null,
                $e
            );
        }

        return $this->instances[$name];
    }
862324
protected function getManager($name)
    {
        // Python has 'python', 'python2', and 'python3'.
        if (strpos('python', $name) === 0) {
            return new DependencyManager\Pip($this->shell);
        }

        $stacks = [
            'nodejs' => new DependencyManager\Npm($this->shell),
            'ruby' => new DependencyManager\Bundler($this->shell),
            'php' => new DependencyManager\Composer($this->shell),
        ];
        if (isset($stacks[$name])) {
            return $stacks[$name];
        }

        throw new \InvalidArgumentException(sprintf('Unknown dependencies stack: %s', $name));
    }
463362
private function getObjectManager($entityClassname)
    {
        $objectManager = $this->getContainer()->get('doctrine')->getManagerForClass($entityClassname);
        if ($objectManager) {
            return $objectManager;
        }

        $objectManager = $this->getContainer()->get('doctrine_mongodb')->getManagerForClass($entityClassname);
        if ($objectManager) {
            return $objectManager;
        }

        throw new \RuntimeException(sprintf('Class "%s" is not a managed entity', $entityClassname));
    }
447673
private function createRole(ObjectManager $manager, $name)
    {
        $role = new Role($name);
        $manager->persist($role);

        return $role;
    }
1080069
public function getGenerator($name)
    {
        if ($this->hasGenerator($name) === false) {
            throw new \RuntimeException(sprintf('Generator not found: "%s".', $name));
        }

        return $this->generators[$name];
    }
611561
private function builderMustExist($name)
    {
        if (!$this->hasBuilder($name)) {
            throw new FoundationException(
                sprintf(
                    "No such builder '%s'. Available builders are {%s}.",
                    $name,
                    join(
                        ', ',
                        array_map(
                            function ($val) {
                                return sprintf("'%s'", $val);
                            },
                            array_keys($this->getSessionBuilders())
                        )
                    )
                )
            );
        }

        return $this;
    }
810977
public function & getMethod( $name )
	{
		if( isset( $this->methods[$name] ) )
			return $this->methods[$name];
		throw new RuntimeException( "Method '$name' is unknown" );
	}
394852
protected function getter($name)
    {
        $value = parent::getter($name);
        $name = $this->getProperty($name);
        if (null == $value) {
            $relMap = EntityDescriptorRegistry::getInstance()
                ->getDescriptorFor(get_class($this))
                ->getRelationsMap();
            if ($relMap->containsKey($name)) {
                $value = $relMap->get($name)->load($this);
            }
        }
        return $value;
    }
397511
public function get(string $name)
    {
        if (isset($this->workerClassMap[$name])) {
            return $this->container->get($this->workerClassMap[$name]);
        }
        return $this->container->get($name);
    }
454148
protected function getObjectManagerByName($name)
    {
        if (array_key_exists($name, $this->objectManagerByName)) {
            return $this->objectManagerByName[$name];
        }

        $event = clone $this->getManagerRegistryResourceEventPrototype();
        $event->setName(ManagerRegistryResourceEvent::RESOLVE_OBJECT_MANAGER_EVENT);
        $event->setResourceName($name);
        $event->setTarget($this);


        $resultsEvent = $this->getEventManager()->trigger($event, function ($objectManager) {
            return $objectManager instanceof ObjectManager;
        });

        $objectManager = $resultsEvent->last();

        if (!$objectManager instanceof ObjectManager) {
            $errMsg = sprintf('Object manager %s not found', $name);
            throw new Exception\ObjectManagerNotFoundException($errMsg);
        }

        $this->objectManagerByName[$name] = $objectManager;

        return $this->objectManagerByName[$name];
    }
950595
public function getManager($force = false)
    {
        if ($force === true) {
            $this->wipe();
        }

        if (!$this->manager instanceof ObjectManager) {
            $this->manager = $this->buildManager();
        }

        return $this->manager;
    }