You are here

private function MenuMultilingualLinkTreeModifier::linkIsTranslated in Menu Multilingual 8

Check link for translations or current language.

Parameters

mixed $link: The link that will be checked.

string $lang: The language id.

Return value

bool True if link pass a multilingual options.

1 call to MenuMultilingualLinkTreeModifier::linkIsTranslated()
MenuMultilingualLinkTreeModifier::hasTranslationOrIsDefaultLang in src/Menu/MenuMultilingualLinkTreeModifier.php
Check link for translation or current language.

File

src/Menu/MenuMultilingualLinkTreeModifier.php, line 225

Class

MenuMultilingualLinkTreeModifier
Class MenuMultilingualLinkTreeModifier.

Namespace

Drupal\menu_multilingual\Menu

Code

private function linkIsTranslated($link, $lang) {
  $result = FALSE;
  $callbacks = [
    'isTranslatedMenuLinkContentMultilingual' => $this
      ->isTranslatedMenuLinkContentMultilingual($link, $lang),
    'isTranslatedViewLink' => $this
      ->isTranslatedViewLink($link, $lang),
  ];
  foreach ($callbacks as $condition_check) {
    if ($condition_check === NULL) {
      continue;
    }
    $result = $condition_check;
    break;
  }
  return $result;
}