示例#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() : '') . ')';
 }
示例#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);
 }
示例#3
0
文件: Graph.php 项目: kingsj/core
 /**
  * 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() : '') . ')';
 }