You are here

public function EntityLegalDocument::getPublishedVersion in Entity Legal 7.2

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

Get the current published version of this document.

Return value

bool|EntityLegalDocumentVersion The current legal document version or FALSE if none found.

5 calls to EntityLegalDocument::getPublishedVersion()
EntityLegalDocument::getAcceptanceLabel in ./entity_legal.entity.inc
Get the label to be shown on the acceptance checkbox.
EntityLegalDocument::getAcceptances in ./entity_legal.entity.inc
Get the acceptances for this entity legal document revision.
EntityLegalDocument::getVersion in ./entity_legal.entity.inc
Get a version of this document.
EntityLegalDocument::getVersionLabel in ./entity_legal.entity.inc
Get the title of the attached version.
EntityLegalDocument::userMustAgree in ./entity_legal.entity.inc
Checks to see if a given user can agree to this document.

File

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

Class

EntityLegalDocument
Legal Document entity with revision support.

Code

public function getPublishedVersion() {
  $published_version = FALSE;
  drupal_alter('entity_legal_published_version', $this->published_version, $this);
  if (!empty($this->published_version)) {
    $published_version = entity_load_single(ENTITY_LEGAL_DOCUMENT_VERSION_ENTITY_NAME, $this->published_version);
  }
  return $published_version;
}