Resolves component by its id

@param string $id

@return mixed
@throws ContainerException
559555
protected function resolve($id)
    {
        $keys = explode(self::SEPARATOR, $id);
        $node = & $this->components;

        while ($key = array_shift($keys)) {
            if (!is_array($node) || !array_key_exists($key, $node)) {
                throw new ContainerException(sprintf('Invalid or unknown component/parameter identifier "%s"', $id));
            }

            $node = & $node[$key];
        }

        return is_callable($node) ? $node($this) : $node;
    }
565340
public function resolveUserFunction($id)
    {
        if ($this->cache->contains($id)) {
            return $this->cache->fetch($id);
        }

        $user = $this->userRepository->findUserById($id);
        if (null === $user) {
            return;
        }

        $this->cache->save($id, $user);

        return $user;
    }
411331
private function find($id)
    {
        if (! isset($this->registry[$id])) {
            throw new NotFoundException("Entry id '" . $id . "' not found in container");
        }

        return $this->registry[$id];
    }
712528
public function raw($id)
    {
        try {
            return parent::raw($id);
        } catch (UnknownIdentifierException $e) {
            throw new ContainerNotFoundException(
                $e->getMessage(),
                $e->getCode(),
                $e
            );
        } catch (\Throwable $e) {
            throw new ContainerException(
                $e->getMessage(),
                $e->getCode(),
                $e
            );
        }
    }
1197717
protected function component($id)
    {
        $model = $this->repository->findOneById($id);
        if (is_null($model)) {
            return new JsonResponse(['message' => ''], 200);
        }
        $classname = $model->data['classname'];
        $instance  = new $classname;

        if ($instance->getAttribute('ajaxable') === false) {
            return new JsonResponse('', 302);
        }
        $inputs = Input::get('attributes');

        if (!is_null($inputs) and method_exists($instance, 'hydrate')) {
            $args = empty($inputs) ? [] : unserialize($inputs);
            $instance->hydrate($args);
        }
        return $instance;
    }
236839
private function get(String $id)
	{
		if (!$id) {
			$id = ConnectionManager::DEFAULT_CONNECTION_ID;
		}

		if (count($this->loadedConnections) < 1) {
			return false;
		}

		if (isset($this->loadedConnections[$id])) {
			$this->configuredConnectionId = $id;
			$this->platformConnector = [$id => $this->loadedConnections[$id]];
			$connector = new PlatformResolver($this);
			return $connector->resolvePlatform(new EventManager());
		}
	}
963937
public function resolveId($id = null)
    {
        if ($id === null) {
            $id = $this->owner->getId();
        }
        if (isset($this->owner->htmlOptions['id'])) {
            $id = $this->owner->htmlOptions['id'];
        } else {
            $this->owner->htmlOptions['id'] = $id;
        }
        return $id;
    }
697328
protected function resolveUser($id)
	{
		if (!is_numeric($id))
		{
			if (strstr($id, '@'))
			{
				$user = User::oneByEmail($id);
			}
			else
			{
				$user = User::oneByUsername($id);
			}
		}
		else
		{
			$user = User::oneOrNew($id);
		}

		return $user;
	}
109784
public function resolve(ContainerInterface $container, $id, $definition)
    {
        $definition = substr($definition, 1);
        if ($container->has($definition)) {
            return $container->get($definition);
        }

        return false;
    }
672395
public function get($id)
	{
	    if (isset($this->_definitions[$id]) && is_object($this->_definitions[$id]) && !is_callable($this->_definitions[$id])) {
	        $this->_components[$id] = $this->_definitions[$id];
	    } elseif (!isset($this->_components[$id])) {
	        if (!isset($this->_definitions[$id])) {
	            throw new \RuntimeException('Must set components before use: ' . $id);
	        }
	        
	        $this->_components[$id] = Ioc::createObject($this->_definitions[$id]);
	    }
	    
	    return $this->_components[$id];
	}
1069668
public function has($id)
    {
        if (isset($this->resolved[$id])) {
            return true;
        }

        if (isset($this->definitions[$id])) {
            return true;
        }

        // How can this be moved to the ReflectionResolver?
        if (class_exists($id)) {
            return true;
        }

        return false;
    }
1053541
private function getComponentConfig(string $id): array
    {
        foreach ($this->storage[$id]['arguments'] as &$value) {
            $this->resolveComponent($value);
        }
        return $this->storage[$id];
    }
676578
@Nullable
    public Container getContainerWithId(@Nonnull String id) {
        if (id == null || id.trim().length() == 0) {
            throw new IllegalArgumentException("A container ID must be provided.");
        }

        for (Container container : getContainers()) {
            if (container.getId().equals(id)) {
                return container;
            }
        }

        return null;
    }
1341831
private function getDefinition($id)
    {
        $id = $this->getDefinitionId($id);

        return null === $id ? null : $this->container->getDefinition($id);
    }
708284
protected function getContainerParameter($id, $default = null)
    {
        if ($this->container->hasParameter($id)) {
            return $this->container->getParameter($id);
        }

        return $default;
    }
752113
public function has($id)
    {
        if (!is_string($id)) {
            throw new ContainerException('$id must be a string');
        }

        if (array_key_exists($id, $this->definitions)) {
            return true;
        }

        return false;
    }
865250
public function resolve($id)
    {
        foreach ($this->transformers as $contentType => $transformer) {
            if (stripos($id, $contentType) === 0) {
                return $transformer;
            }
        }
    }