You are here

private function MailchimpCampaignForm::buildEntityViewModeOptionList in Mailchimp 8

Same name and namespace in other branches
  1. 2.x modules/mailchimp_campaign/src/Form/MailchimpCampaignForm.php \Drupal\mailchimp_campaign\Form\MailchimpCampaignForm::buildEntityViewModeOptionList()

Returns an options list of entity view modes.

Parameters

string $entity_type: Entity type to build view mode options for.

Return value

array Associative array of view mode IDs to name.

1 call to MailchimpCampaignForm::buildEntityViewModeOptionList()
MailchimpCampaignForm::getEntityImportFormElements in modules/mailchimp_campaign/src/Form/MailchimpCampaignForm.php
Gets form elements used in the entity import feature.

File

modules/mailchimp_campaign/src/Form/MailchimpCampaignForm.php, line 569

Class

MailchimpCampaignForm
Form controller for the MailchimpCampaign entity edit form.

Namespace

Drupal\mailchimp_campaign\Form

Code

private function buildEntityViewModeOptionList($entity_type) {
  $options = [];
  $view_modes = $this->entityDisplayRepository
    ->getViewModes($entity_type);
  foreach ($view_modes as $view_mode_id => $view_mode_data) {
    $options[$view_mode_id] = $view_mode_data['label'];
  }
  return $options;
}