You are here

protected function PriceTableDefaultFormatter::getOrientationLabel in Commerce Price Table 8

Return orientation mode label.

Parameters

int $orientation_id: ID of orientation mode.

Return value

string

1 call to PriceTableDefaultFormatter::getOrientationLabel()
PriceTableDefaultFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/PriceTableDefaultFormatter.php
Returns a short summary for the current formatter settings.

File

src/Plugin/Field/FieldFormatter/PriceTableDefaultFormatter.php, line 213

Class

PriceTableDefaultFormatter
Plugin implementation of the 'commerce_price_table' formatter.

Namespace

Drupal\commerce_price_table\Plugin\Field\FieldFormatter

Code

protected function getOrientationLabel($orientation_id) {
  $orientation_options = $this
    ->getOrientationOptionsList();
  if (array_key_exists($orientation_id, $orientation_options)) {
    return $orientation_options[$orientation_id];
  }

  // If no match found, then return default orientation label.
  return $orientation_options[PriceTableDefaultFormatter::HORIZONTAL_MODE];
}