Example #1
0
 /**
  * Remove a version given the path to the version node and the version name.
  *
  * @param $versionPath The path to the version node
  * @param $versionName The name of the version to remove
  * @return void
  *
  * @throws \PHPCR\UnsupportedRepositoryOperationException
  * @throws \PHPCR\ReferentialIntegrityException
  * @throws \PHPCR\Version\VersionException
  */
 public function removeVersion($versionPath, $versionName)
 {
     $this->transport->removeVersion($versionPath, $versionName);
     // Adjust the in memory state
     $absPath = $versionPath . '/' . $versionName;
     if (isset($this->objectsByPath['Node'][$absPath])) {
         $node = $this->objectsByPath['Node'][$absPath];
         unset($this->objectsByUuid[$node->getIdentifier()]);
         $node->setDeleted();
     }
     if (isset($this->objectsByPath['Version\\Version'][$absPath])) {
         $version = $this->objectsByPath['Version\\Version'][$absPath];
         unset($this->objectsByUuid[$version->getIdentifier()]);
         $version->setDeleted();
     }
     unset($this->objectsByPath['Node'][$absPath]);
     unset($this->objectsByPath['Version\\Version'][$absPath]);
     $this->cascadeDelete($absPath, false);
     $this->cascadeDeleteVersion($absPath);
 }