setParent() protected method

protected setParent ( League\CommonMark\Node\Node $node = null )
$node League\CommonMark\Node\Node
 public function replaceChild(ContextInterface $context, AbstractBlock $original, AbstractBlock $replacement)
 {
     if (($index = $this->children->indexOf($original)) !== false) {
         $this->children->remove($index);
         $replacement->setParent($this);
         $this->children->set($index, $replacement);
     } else {
         $this->addChild($replacement);
     }
     if ($context->getTip() === $original) {
         $context->setTip($replacement);
     }
 }