Exemple #1
0
 /**
  * Add child node
  *
  * @param \Includes\DataStructure\Graph $node Node to add
  *
  * @return void
  */
 public function addChild(\Includes\DataStructure\Graph $node)
 {
     $node->setParent($this);
     parent::addChild($node);
 }
Exemple #2
0
 /**
  * So called "re-plant" operation: change node parent
  *
  * @param \Includes\DataStructure\Graph $oldParent Replant from
  * @param \Includes\DataStructure\Graph $newParent Replant to
  *
  * @return void
  */
 public function replant(\Includes\DataStructure\Graph $oldParent, \Includes\DataStructure\Graph $newParent)
 {
     $oldParent->removeChild($this);
     $newParent->addChild($this);
 }
Exemple #3
0
 /**
  * Add child node
  *
  * @param \Includes\DataStructure\Graph $node Node to add
  *
  * @return void
  */
 public function addChild(\Includes\DataStructure\Graph $node)
 {
     parent::addChild($node);
     $node->setParentClass($this->getClass());
 }
Exemple #4
0
 /**
  * Add child node
  *
  * @param self $node Node to add
  *
  * @return void
  */
 public function addChild(self $node)
 {
     parent::addChild($node);
     $node->setParentClass($this->getClass());
 }
Exemple #5
0
 /**
  * So called "re-plant" operation: change node parent
  *
  * @param self $oldParent Replant from
  * @param self $newParent Replant to
  *
  * @return void
  */
 public function replant(self $oldParent, self $newParent)
 {
     $oldParent->removeChild($this);
     $newParent->addChild($this);
 }