示例#1
0
文件: Node.php 项目: lostcause/baum
 /**
  * Maps the provided tree structure into the database using the current node
  * as the parent. The provided tree structure will be inserted/updated as the
  * descendancy subtree of the current node instance.
  *
  * @param   array|\Illuminate\Support\Contracts\ArrayableInterface
  * @return  boolean
  */
 public function updateTree($nodeList)
 {
     $mapper = new SetMapper($this);
     return $mapper->updateMap($nodeList);
 }
示例#2
0
文件: Node.php 项目: zorx/baum
 /**
  * Maps the provided tree structure into the database using the current node
  * as the parent. The provided tree structure will be inserted/updated as the
  * descendancy subtree of the current node instance.
  *
  * @param   array|\Illuminate\Support\Contracts\ArrayableInterface
  * @return  bool
  */
 public function makeTree($nodeList)
 {
     $mapper = new SetMapper($this);
     return $mapper->map($nodeList);
 }