/** * @inheritdoc */ public function mergeWith(Graph $graph) : Graph { foreach ($graph->getNodes() as $node) { $this->addNodeWithNoMerge($node); } $this->edges = array_merge($this->edges, $graph->getEdges()); return $this; }
public function AddAsChild($node, $parent) { $arrow = new DefaultEdge($parent, $node); $this->graph->addEdge($arrow); return $this; }