You are here

protected function ShareMessageForm::getBundles in Share Message 8

Gets the bundles of the selected content entity type.

Parameters

string $entity_type: The entity type where to retrieve the bundles.

Return value

array An associative array of bundle's labels keyed by the bundle's ID.

1 call to ShareMessageForm::getBundles()
ShareMessageForm::form in src/Form/ShareMessageForm.php
Overrides Drupal\Core\Entity\EntityFormController::form().

File

src/Form/ShareMessageForm.php, line 431

Class

ShareMessageForm
Base form controller for Share Message edit forms.

Namespace

Drupal\sharemessage\Form

Code

protected function getBundles($entity_type) {
  $extra_field_bundle_options = [];
  foreach ($this->entityTypeBundleInfo
    ->getBundleInfo($entity_type) as $bundle => $info) {
    $extra_field_bundle_options[$bundle] = $info['label'];
  }
  return $extra_field_bundle_options;
}