You are here

protected function ConnectionTypeForm::getBundleOptions in RedHen CRM 8

Get the bundle options for a provided endpoint (entity) type.

Parameters

string $endpoint_type:

Return value

array

2 calls to ConnectionTypeForm::getBundleOptions()
ConnectionTypeForm::form in modules/redhen_connection/src/Form/ConnectionTypeForm.php
Gets the actual form array to be built.
ConnectionTypeForm::updateBundleOptions in modules/redhen_connection/src/Form/ConnectionTypeForm.php
Ajax callback to update the bundle options.

File

modules/redhen_connection/src/Form/ConnectionTypeForm.php, line 166

Class

ConnectionTypeForm
Class ConnectionTypeForm.

Namespace

Drupal\redhen_connection\Form

Code

protected function getBundleOptions($endpoint_type) {
  $bundles = $this->entityTypeBundleInfo
    ->getBundleInfo($endpoint_type);
  $bundle_options = [];
  foreach ($bundles as $bundle_name => $bundle_info) {
    $bundle_options[$bundle_name] = $bundle_info['label'];
  }
  natsort($bundle_options);
  return $bundle_options;
}