Example #1
0
 /**
  * Prepare and return error message
  *
  * @param string                        $code Error code (or message)
  * @param \Includes\DataStructure\Graph $node Node  Node caused the error OPTIONAL
  *
  * @return string
  */
 protected function prepareErrorMessage($code, \Includes\DataStructure\Graph $node = null)
 {
     return $code . ' (' . $this->getKey() . ($node ? ', ' . $node->getKey() : '') . ')';
 }
Example #2
0
 /**
  * Remove child node
  *
  * @param \Includes\DataStructure\Graph $node Node to remove
  *
  * @return void
  */
 public function removeChild(\Includes\DataStructure\Graph $node)
 {
     foreach ($this->getChildren() as $index => $child) {
         if ($node->getKey() === $child->getKey()) {
             $node->setParent(null);
         }
     }
     parent::removeChild($node);
 }
Example #3
0
 /**
  * Prepare and return error message
  *
  * @param string $code Error code (or message)
  * @param self   $node Node  Node caused the error OPTIONAL
  *
  * @return string
  */
 protected function prepareErrorMessage($code, self $node = null)
 {
     return $code . ' (' . $this->getKey() . ($node ? ', ' . $node->getKey() : '') . ')';
 }