You are here

private function SettingsFormWarning::getBundles in General Data Protection Regulation Compliance 8

Implements a form submit handler.

1 call to SettingsFormWarning::getBundles()
SettingsFormWarning::buildForm in src/Form/SettingsFormWarning.php
Form constructor.

File

src/Form/SettingsFormWarning.php, line 165

Class

SettingsFormWarning
Implements the form controller.

Namespace

Drupal\gdpr_compliance\Form

Code

private function getBundles($enity_type) {
  if ($enity_type == 'webform') {
    $wforms = $this->entityTypeManager
      ->getStorage('webform')
      ->loadMultiple();
    $bundles = [];
    foreach ($wforms as $wform) {
      $bundles[$wform
        ->id()]['label'] = $wform
        ->label();
    }
  }
  else {
    $bundles = $this->entityTypeBundle
      ->getBundleInfo($enity_type);
  }
  return $bundles;
}