You are here

public function PluralFormula::getFormula in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/PluralFormula.php \Drupal\locale\PluralFormula::getFormula()

Gets the plural formula for a langcode.

Parameters

string $langcode: The language code to get the formula for.

Return value

array An array of formulae.

Overrides PluralFormulaInterface::getFormula

File

core/modules/locale/src/PluralFormula.php, line 92
Contains \Drupal\locale\PluralFormula.

Class

PluralFormula
Manages the storage of plural formula per language in state.

Namespace

Drupal\locale

Code

public function getFormula($langcode) {
  $this
    ->loadFormulae();
  return isset($this->formulae[$langcode]['formula']) ? $this->formulae[$langcode]['formula'] : FALSE;
}