You are here

function getLabelBundle in Form Mode Control 8

Return the label of the bundle.(Ex. article => Article) Machine name of the entity type.

Parameters

$entity_type:

$bundle_searched:

Return value

mixed

2 calls to getLabelBundle()
FormModeConfigForm::buildForm in src/Form/FormModeConfigForm.php
Form constructor.
FormModePermission::roleToFormMode in src/FormModePermission.php

File

./form_mode_control.module, line 238

Code

function getLabelBundle($entity_type, $bundle_searched) {
  $bundles = \Drupal::entityManager()
    ->getBundleInfo($entity_type);
  foreach ($bundles as $bundle => $label_bundle) {
    if ($bundle_searched == $bundle) {
      return $label_bundle['label'];
    }
  }
}