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));
    }
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));
    }
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 ) ) ; }
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
Returns a node or a subgraph given his id .