You are here

public static function AutoEntityLabelManager::auto_entitylabel_options in Automatic Entity Label 8.2

Same name and namespace in other branches
  1. 8.3 src/AutoEntityLabelManager.php \Drupal\auto_entitylabel\AutoEntityLabelManager::auto_entitylabel_options()
  2. 8 src/AutoEntityLabelManager.php \Drupal\auto_entitylabel\AutoEntityLabelManager::auto_entitylabel_options()

Constructs the list of options for the given bundle.

@codingStandardsIgnoreStart

File

src/AutoEntityLabelManager.php, line 350

Class

AutoEntityLabelManager
Class for Auto Entity Label Manager.

Namespace

Drupal\auto_entitylabel

Code

public static function auto_entitylabel_options($entity_type, $bundle_name) {

  // @codingStandardsIgnoreEnd
  $options = [
    'auto_entitylabel_disabled' => t('Disabled'),
  ];
  if (self::auto_entitylabel_entity_label_visible($entity_type)) {
    $options += [
      'auto_entitylabel_enabled' => t('Automatically generate the label and hide the label field'),
      'auto_entitylabel_optional' => t('Automatically generate the label if the label field is left empty'),
    ];
  }
  else {
    $options += [
      'auto_entitylabel_enabled' => t('Automatically generate the label'),
    ];
  }
  return $options;
}