You are here

public function EntityLegalDocumentAcceptance::getDocumentVersion in Entity Legal 8.2

Same name and namespace in other branches
  1. 4.0.x src/Entity/EntityLegalDocumentAcceptance.php \Drupal\entity_legal\Entity\EntityLegalDocumentAcceptance::getDocumentVersion()
  2. 3.0.x src/Entity/EntityLegalDocumentAcceptance.php \Drupal\entity_legal\Entity\EntityLegalDocumentAcceptance::getDocumentVersion()

Get the document version this acceptance belongs to.

Return value

\Drupal\entity_legal\EntityLegalDocumentVersionInterface The version of the document corresponding to this acceptance.

Overrides EntityLegalDocumentAcceptanceInterface::getDocumentVersion

File

src/Entity/EntityLegalDocumentAcceptance.php, line 87

Class

EntityLegalDocumentAcceptance
Defines the entity legal document acceptance entity.

Namespace

Drupal\entity_legal\Entity

Code

public function getDocumentVersion() {

  /** @var \Drupal\Core\Field\EntityReferenceFieldItemListInterface $item */
  $item = $this
    ->get('document_version_name');
  return $item
    ->referencedEntities()[0];
}