You are here

public function WebformEncryptSubmissionStorage::decryptChildren in Webform Encrypt 8

Helper function to recursively decrypt children of fields.

Parameters

array $data: Element data by reference.

bool $check_permissions: Flag that controls permissions check.

Throws

\Drupal\encrypt\Exception\EncryptException

1 call to WebformEncryptSubmissionStorage::decryptChildren()
WebformEncryptSubmissionStorage::decryptElements in src/WebformEncryptSubmissionStorage.php
Helper function to recursively decrypt fields.

File

src/WebformEncryptSubmissionStorage.php, line 227

Class

WebformEncryptSubmissionStorage
Alter webform submission storage definitions.

Namespace

Drupal\webform_encrypt

Code

public function decryptChildren(array &$data, $check_permissions = TRUE) {
  foreach ($data as $key => $value) {
    if (is_array($value)) {
      $this
        ->decryptChildren($data[$key], $check_permissions);
    }
    else {
      $decrypted_value = $this
        ->decrypt($value, $check_permissions);
      $data[$key] = $decrypted_value;
    }
  }
}