You are here

public function PcaAddressFieldWidgetTrait::buildFieldWidgetSettingsSummary in Loqate 2.x

Same name and namespace in other branches
  1. 8 src/PcaAddressFieldWidgetTrait.php \Drupal\loqate\PcaAddressFieldWidgetTrait::buildFieldWidgetSettingsSummary()

Build the widget settings summary.

2 calls to PcaAddressFieldWidgetTrait::buildFieldWidgetSettingsSummary()
AddressPcaAddressWidget::settingsSummary in modules/pca_address/src/Plugin/Field/FieldWidget/AddressPcaAddressWidget.php
LoqatePcaAddressDefaultWidget::settingsSummary in src/Plugin/Field/FieldWidget/LoqatePcaAddressDefaultWidget.php
Returns a short summary for the current widget settings.

File

src/PcaAddressFieldWidgetTrait.php, line 54

Class

PcaAddressFieldWidgetTrait
Class PcaAddressFieldWidgetTrait.

Namespace

Drupal\loqate

Code

public function buildFieldWidgetSettingsSummary() {
  $summary = [];
  $widget_settings = $this
    ->getSettings();
  $summary[] = $this
    ->t('Show address fields: @bool', [
    '@bool' => (bool) $widget_settings['show_address_fields'] ? 'Yes' : 'No',
  ]);
  $summary[] = $this
    ->t('Allow manual input: @bool', [
    '@bool' => (bool) $widget_settings['allow_manual_input'] ? 'Yes' : 'No',
  ]);
  $summary[] = $this
    ->t('Key ID: @key', [
    '@key' => !empty($widget_settings['loqate_api_key']) ? $widget_settings['loqate_api_key'] : 'None',
  ]);
  return $summary;
}