Example #1
0
 /**
  * Restore the node at $nodePath to the version at $versionPath
  *
  * Clears the node's cache after it has been restored.
  *
  * TODO: This is incomplete. Needs batch processing to implement restoring an array of versions
  *
  * @param bool $removeExisting whether to remove the existing current
  *      version or create a new version after that version
  * @param string $versionPath
  * @param string $nodePath    absolute path to the node
  */
 public function restore($removeExisting, $versionPath, $nodePath)
 {
     // TODO: handle pending move operations?
     if (isset($this->objectsByPath['Node'][$nodePath])) {
         $this->objectsByPath['Node'][$nodePath]->setDirty();
     }
     if (isset($this->objectsByPath['Version\\Version'][$versionPath])) {
         $this->objectsByPath['Version\\Version'][$versionPath]->setDirty();
     }
     $this->transport->restoreItem($removeExisting, $versionPath, $nodePath);
 }