You are here

public function EncryptionProfile::getEncryptionKey in Encrypt 8.3

Gets the Key entity used in the encryption profile.

Return value

\Drupal\key\Entity\Key The used Key entity.

Overrides EncryptionProfileInterface::getEncryptionKey

1 call to EncryptionProfile::getEncryptionKey()
EncryptionProfile::validate in src/Entity/EncryptionProfile.php
Validate the EncryptionProfile entity.

File

src/Entity/EncryptionProfile.php, line 168

Class

EncryptionProfile
Defines the EncryptionProfile entity.

Namespace

Drupal\encrypt\Entity

Code

public function getEncryptionKey() {
  if (!isset($this->encryption_key_entity) || $this->encryption_key_entity
    ->id() != $this
    ->getEncryptionKeyId()) {
    $this->encryption_key_entity = $this
      ->getKeyRepository()
      ->getKey($this
      ->getEncryptionKeyId());
  }
  return $this->encryption_key_entity;
}