/** * Insert operation internal handler * @param bool $forward * @throws Exception */ protected function insertNearInternal($forward) { $this->checkNode(true); $this->owner->setAttribute($this->parentAttribute, $this->node->getAttribute($this->parentAttribute)); if ($this->sortable !== false) { if ($forward) { $this->behavior->moveAfter($this->node); } else { $this->behavior->moveBefore($this->node); } } }
/** * Insert operation internal handler * @param bool $forward * @throws Exception */ protected function insertNearInternal($forward) { $this->checkNode(true); $item = $this->owner->getAttribute($this->itemAttribute); if ($item !== null) { $path = $this->node->getParentPath(); $this->owner->setAttribute($this->pathAttribute, $path . $this->delimiter . $item); } $this->owner->setAttribute($this->depthAttribute, $this->node->getAttribute($this->depthAttribute)); if ($this->treeAttribute !== null) { $this->owner->setAttribute($this->treeAttribute, $this->node->getAttribute($this->treeAttribute)); } if ($this->sortable !== false) { if ($forward) { $this->behavior->moveAfter($this->node); } else { $this->behavior->moveBefore($this->node); } } }