Returns a node or a subgraph, given his id.

@param string $id the identifier of the node/graph to fetch

@return Node|Graph

@throws InvalidArgumentException node or graph not found
188351
public function get($id)
    {
        foreach ($this->instructions as $instruction) {
            if (!$instruction instanceof Node && !$instruction instanceof Subgraph) {
                continue;
            }

            if ($instruction->getId() == $id) {
                return $instruction;
            }
        }

        throw new \InvalidArgumentException(sprintf('Found no node or graph with id "%s" in "%s".', $id, $this->id));
    }
118678
public function get($id)
    {
        if (null === $id) {
            return;
        }

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

        $node = $this->repository->find($id);

        if (empty($node) or $node->isDeleted()) {
            return null;
        }

        return $node;
    }
1317353
public function offsetGet($id)
    {
        $this->lock();

        if (!empty($this->resolving[$id])) {
            $chain = implode(' -> ', array_keys($this->resolving));
            throw new InvalidArgumentException("Circular dependency found: $chain -> $id");
        }

        $this->resolving[$id] = true;
        $return = $this->getServiceOrParameter($id);
        unset($this->resolving[$id]);

        return $return;
    }
824908
public function get(int $id)
    {
        if ($id === null) {
            return null;
        }

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

        // Entities are mutable
        // Search through the previously null-id entities
        // in case an id has been set now.
        foreach ($this->nullIdEntities as $entity) {
            if ($entity->getId() === $id) {
                return $entity;
            }
        }

        return null;
    }
1054099
public function getGateway($id)
    {
        if (!array_key_exists($id, $this->_gateways)) {
            throw new InvalidParamException("Unknown gateway '{$id}'.");
        }
        if (!is_object($this->_gateways[$id])) {
            $this->_gateways[$id] = $this->createGateway($id, $this->_gateways[$id]);
        }
        return $this->_gateways[$id];
    }
1035988
public static function getConnection($id){
        
        if(isset(static::$connections[$id]) && !is_object(static::$connections[$id]) ){
            unset(static::$connections[$id]);
        }
        
        return isset(static::$connections[$id]) ? static::$connections[$id] : null;
    }
382492
public function get_item($id)
	{
		// Element empty!
		if (count($this->_items) === 0)
			return FALSE;

		if (array_key_exists($id, $this->_items))
		{ // By ID
			return $this->_items[$id];
		} else
		{ // By route
			$path = $this->get_tree_index(Route::get($id));

			if($path != false)
			{
				$levels = count($path);

				$item = $this->_items[$path[0]];

				if($levels > 1)
				{
					for($i=1; $i<$levels; $i++)
					{
						$item = $item->siblings[$path[$i]];
					}
				}
				return $item;
			}
		}
		return FALSE;
	}
409149
public static function nodePath($id)
    {
        $node = static::node($id);
        if (empty($node)) return '';

        if (empty($node->nodePath)) {
            $node->nodePath = static::nodePath($node->parent_id) . '/' . $node->slug;
        }
        return $node->nodePath;
    }
1369020
public function getChildById($id)
    {
        foreach ($this->children as $child) {
            if ($child->id === $id) {
                return $child;
            }

            $subChild = $child->getChildById($id);
            if ($subChild !== null) {
                return $subChild;
            }
        }

        return null;
    }
68418
public function getSubtree($id)
    {
        $primaryKey = $this->mapper->getPrimaryKey($this->getTable());
        $entities = $this->getSubtreeData($id, $primaryKey);
        $children = array();
        foreach ($entities as $entity) {
            $key = $entity->ancestor->id;
            if (!isset($children[$key])) {
                $children[$key] = array();
            }
            $children[$key][] = $entity;
        }

        return $this->getChildNodes($id, $children, $entities, $primaryKey);
    }
64085
public function one($id) {

		if($this->_where) {
			throw new InvalidCallException(__METHOD__.'() can not be called with "where" clause');
		}

		$model = $this->_populate(
			$this->_request('get',
				$this->_getUrl('element', $id),
				[
					'query' => $this->_buildQueryParams()
				]
			),
			false
		);

		return $model;
	}
626021
public function fetchById($id)
    {
        $data = parent::fetchById($id);
        if ($data) {
            foreach (array_keys($this->subAttributeList) as $subKey) {
                $data[$subKey] = $this->fetchSubAttributeById($id, $subKey);
            }
        }
        return $data;
    }
1325216
public function findOneById($id)
    {
        $id = $this->idToMongo($id);

        if ($this->identityMap->has($id)) {
            return $this->identityMap->get($id);
        }

        return $this->createQuery(array('_id' => $id))->one();
    }
844203
public function findParentNodesByChildId($id)
	{
        // To be returned
        $result = array();

        $rl = $this->getRelations();
        $data = $rl[RelationBuilder::TREE_PARAM_ITEMS];

        // If can't find, then return empty array
        if (!isset($data[$id])) {
            return array();
        }

        $current = $data[$id];
        $parentId = $current[RelationBuilder::TREE_PARAM_PARENT_ID];

        while (isset($data[$parentId])) {
            $current = $data[$parentId];
            $parentId = $current[RelationBuilder::TREE_PARAM_PARENT_ID];

            array_push($result, $current);
        }

        return $result;
    }
966161
public function getById($id)
    {
        if (isset($this->elements[$id])) {
            return $this->elements[$id];
        }

        throw new \InvalidArgumentException(sprintf('Element for id %s does not exist', $id));
    }
847391
public function getAlias($id)
    {
        $id = $this->normalizeId($id);

        if (!isset($this->aliasDefinitions[$id])) {
            throw new InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $id));
        }

        return $this->aliasDefinitions[$id];
    }
397837
private function findNode($id)
    {
        $node = $this->get('clastic.node_manager')
            ->loadNode($id);

        if (!$node) {
            throw new NotFoundHttpException();
        }

        return $node;
    }