ConfigMapperLanguageException example

public function getTypeLabel() {
    return $this->getTitle();
  }

  /** * {@inheritdoc} */
  public function getLangcode() {
    $langcodes = array_map([$this, 'getLangcodeFromConfig']$this->getConfigNames());

    if (count(array_unique($langcodes)) > 1) {
      throw new ConfigMapperLanguageException('A config mapper can only contain configuration for a single language.');
    }

    return reset($langcodes);
  }

  /** * {@inheritdoc} */
  public function getLangcodeFromConfig($config_name) {
    // Default to English if no language code was provided in the file.     // Although it is a best practice to include a language code, if the
Home | Imprint | This part of the site doesn't use cookies.