You are here

private function AddressDisplayFormatter::getLabels in Address Display 8

Helper function to get address components label.

Return value

array

2 calls to AddressDisplayFormatter::getLabels()
AddressDisplayFormatter::settingsForm in src/Plugin/Field/FieldFormatter/AddressDisplayFormatter.php
Returns a form to configure settings for the formatter.
AddressDisplayFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/AddressDisplayFormatter.php
Returns a short summary for the current formatter settings.

File

src/Plugin/Field/FieldFormatter/AddressDisplayFormatter.php, line 100

Class

AddressDisplayFormatter
Plugin implementation of the 'Address Display' formatter.

Namespace

Drupal\address_display\Plugin\Field\FieldFormatter

Code

private function getLabels() {
  $values = LabelHelper::getGenericFieldLabels();
  return [
    'given_name' => $values['givenName'],
    'additional_name' => $values['additionalName'],
    'family_name' => $values['familyName'],
    'organization' => $values['organization'],
    'address_line1' => $values['addressLine1'],
    'address_line2' => $values['addressLine2'],
    'postal_code' => $values['postalCode'],
    'sorting_code' => $values['sortingCode'],
    'administrative_area' => $values['administrativeArea'],
    'locality' => $values['locality'],
    'dependent_locality' => $values['dependentLocality'],
    'country_code' => $this
      ->t('Country code'),
    'langcode' => $this
      ->t('Langcode'),
  ];
}