code: public function renamePage($id, $newName)
      {
          $this->pages[$newName] = $this->getPage($id);
          unset($this->pages[$id]);
          $this->persist();
      }
docs: Changes the id of a page.
  
  @param string $id
  @param string $newName