checkin() public method

TODO: document more clearly
See also: VersionManager::checkin
public checkin ( string $absPath ) : PHPCR\Version\VersionInterface
$absPath string
return PHPCR\Version\VersionInterface node version
Example #1
0
 /**
  * {@inheritDoc}
  *
  * @api
  */
 public function checkin($absPath)
 {
     if ($node = $this->objectManager->getCachedNode($absPath)) {
         if ($node->isModified()) {
             throw new InvalidItemStateException("You may not checkin node at {$absPath} with pending unsaved changes");
         }
     }
     $version = $this->objectManager->checkin($absPath);
     $version->setCachedPredecessorsDirty();
     if ($history = $this->objectManager->getCachedNode(PathHelper::getParentPath($version->getPath()), 'Version\\VersionHistory')) {
         $history->notifyHistoryChanged();
     }
     if ($node) {
         // OPTIMIZE: set property jcr:isCheckedOut on node directly? but without triggering write on save()
         $node->setDirty();
     }
     return $version;
 }