/** * Append to operation internal handler * @param bool $append * @throws Exception */ protected function insertIntoInternal($append) { $this->checkNode(false); $this->owner->setAttribute($this->parentAttribute, $this->node->getPrimaryKey()); if ($this->sortable !== false) { if ($append) { $this->behavior->moveLast(); } else { $this->behavior->moveFirst(); } } }
/** * Append to operation internal handler * @param bool $append * @throws Exception */ protected function insertIntoInternal($append) { $this->checkNode(false); $item = $this->owner->getAttribute($this->itemAttribute); if ($item !== null) { $path = $this->node->getAttribute($this->pathAttribute); $this->owner->setAttribute($this->pathAttribute, $path . $this->delimiter . $item); } $this->owner->setAttribute($this->depthAttribute, $this->node->getAttribute($this->depthAttribute) + 1); if ($this->treeAttribute !== null) { $this->owner->setAttribute($this->treeAttribute, $this->node->getAttribute($this->treeAttribute)); } if ($this->sortable !== false) { if ($append) { $this->behavior->moveLast(); } else { $this->behavior->moveFirst(); } } }