You are here

private function CustomBreadcrumbsForm::getEntityBundle in Custom Breadcrumbs 1.x

Get list of entity bundle.

Parameters

string $entity: Entity type.

Return value

array Array of values.

1 call to CustomBreadcrumbsForm::getEntityBundle()
CustomBreadcrumbsForm::form in src/Form/CustomBreadcrumbsForm.php
Gets the actual form array to be built.

File

src/Form/CustomBreadcrumbsForm.php, line 308

Class

CustomBreadcrumbsForm
Custom breadcrumbs form.

Namespace

Drupal\custom_breadcrumbs\Form

Code

private function getEntityBundle($entity) {
  $options = [];
  $options['_none'] = $this
    ->t('Select entity bundle');
  foreach ($this->entityTypeBundleInfo
    ->getBundleInfo($entity) as $key => $type) {
    $options[$key] = $type['label'];
  }
  return $options;
}