/** * TODO: This is a workaround for a bug in Jackalope which will be fixed in the next * release 1.2: https://github.com/jackalope/jackalope/pull/262. */ private function rename(NodeInterface $node, $name) { $names = (array) $node->getParent()->getNodeNames(); $pos = array_search($node->getName(), $names); $next = isset($names[$pos + 1]) ? $names[$pos + 1] : null; $node->rename($name); if ($next) { $node->getParent()->orderBefore($name, $next); } }
private function renameNode(NodeInterface $node, $nodeName) { if ($node->getName() == $nodeName) { return; } $node->rename($nodeName); }
/** * {@inheritdoc} */ public function rename($newName) { return $this->node->rename($newName); }