You are here

public function EntityLegalDocument::setPublishedVersion in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 entity_legal.entity.inc \EntityLegalDocument::setPublishedVersion()

Set the published document version.

Parameters

EntityLegalDocumentVersion $version_entity: The legal document version to set as the published version.

Return value

bool Whether or not the published version was set successfully.

File

./entity_legal.entity.inc, line 131
Entity API main classes used by entity_legal module.

Class

EntityLegalDocument
Legal Document entity with revision support.

Code

public function setPublishedVersion(EntityLegalDocumentVersion $version_entity) {

  // If the version entity is not of this bundle, fail.
  if ($version_entity->document_name != $this
    ->identifier()) {
    return FALSE;
  }
  $this->published_version = $version_entity
    ->identifier();
  return TRUE;
}