You are here

public function EncryptedFieldComputedProperty::getValue in Field Encryption 3.0.x

Gets the data value.

Return value

mixed The data value.

Overrides TypedData::getValue

File

src/EncryptedFieldComputedProperty.php, line 22

Class

EncryptedFieldComputedProperty
Decrypts the field on demand.

Namespace

Drupal\field_encrypt

Code

public function getValue() {
  if ($this->decryptedData === NULL) {

    /** @var \Drupal\field_encrypt\Plugin\Field\FieldType\EncryptedFieldStorageItem $item */
    $item = $this
      ->getParent();
    $this->decryptedData = $item
      ->decrypt();
  }
  return $this->decryptedData;
}