Exemplo n.º 1
0
 /**
  * Moves node to another ancestor.
  *
  * @return void
  */
 protected function moveNode()
 {
     if ($this->exists) {
         if (is_null($this->closure->ancestor)) {
             $primaryKey = $this->getKey();
             $this->closure->ancestor = $primaryKey;
             $this->closure->descendant = $primaryKey;
             $this->closure->depth = 0;
         }
         if ($this->isDirty($this->getParentIdColumn())) {
             $this->reorderSiblings(true);
             $this->closure->moveNodeTo($this->parent_id);
         }
     }
 }