public function rename($newName)
{
$names = (array) $this->getParent()->getNodeNames();
$pos = array_search($this->name, $names);
$next = isset($names[$pos + 1]) ? $names[$pos + 1] : null;
$newPath = $this->parentPath . '/' . $newName;
if (substr($newPath, 0, 2) === '//') {
$newPath = substr($newPath, 1);
}
$this->session->move($this->path, $newPath);
if ($next) {
$this->getParent()->orderBefore($newName, $next);
}
}