public static function WebformContentCreatorUtilities::getFormattedEncryptionProfiles in Webform Content Creator 8
Same name and namespace in other branches
- 3.x src/WebformContentCreatorUtilities.php \Drupal\webform_content_creator\WebformContentCreatorUtilities::getFormattedEncryptionProfiles()
- 2.x src/WebformContentCreatorUtilities.php \Drupal\webform_content_creator\WebformContentCreatorUtilities::getFormattedEncryptionProfiles()
Get an associative array with encryption profiles and respective labels.
Return value
array Associative array with encryption profiles ids and labels.
1 call to WebformContentCreatorUtilities::getFormattedEncryptionProfiles()
- WebformContentCreatorForm::form in src/
Form/ WebformContentCreatorForm.php - Gets the actual form array to be built.
File
- src/
WebformContentCreatorUtilities.php, line 313
Class
- WebformContentCreatorUtilities
- Provides useful functions required in Webform content creator module.
Namespace
Drupal\webform_content_creatorCode
public static function getFormattedEncryptionProfiles() {
$encryption_profiles = [];
$moduleHandler = \Drupal::service('module_handler');
if ($moduleHandler
->moduleExists('encrypt')) {
$encryption_profiles = \Drupal::service(self::ENTITY_TYPE_MANAGER)
->getStorage('encryption_profile')
->loadMultiple();
}
$encryption_profiles_formatted = [];
foreach ($encryption_profiles as $k => $v) {
$encryption_profiles_formatted[$k] = $v
->label();
}
return $encryption_profiles_formatted;
}