コード例 #1
0
 public function compare(\ORC\Util\Tree\INode $node)
 {
     if ($node instanceof Node) {
         return strcmp($this->get('code'), $node->get('code'));
     }
     throw new RuntimeException('不能比较两个不同类型的node');
 }
コード例 #2
0
 protected function addToData(\ORC\Util\Tree\INode $node, $strict = true)
 {
     if (!isset($this->data[$node->getKey()])) {
         $this->data[$node->getKey()] = $node;
         unset($this->orphan[$node->getKey()]);
     } elseif ($strict) {
         throw new RuntimeException('数据已经存在,不能重复添加');
     }
 }
コード例 #3
0
 public function toString($depth, \ORC\Util\Tree\INode $node)
 {
     return $node->getValue();
 }