You are here

public function MenuLink::hasTranslation in Drupal 10

Same name and namespace in other branches
  1. 9 core/modules/menu_link_content/src/Plugin/migrate/source/MenuLink.php \Drupal\menu_link_content\Plugin\migrate\source\MenuLink::hasTranslation()

Determines if this menu_link has an i18n translation.

Parameters

string $mlid: The menu id.

Return value

bool True if the menu_link has an i18n translation.

1 call to MenuLink::hasTranslation()
MenuLink::prepareRow in core/modules/menu_link_content/src/Plugin/migrate/source/MenuLink.php
Adds additional data to the row.

File

core/modules/menu_link_content/src/Plugin/migrate/source/MenuLink.php, line 177

Class

MenuLink
Drupal 6/7 menu link source from database.

Namespace

Drupal\menu_link_content\Plugin\migrate\source

Code

public function hasTranslation($mlid) {
  if ($this
    ->getDatabase()
    ->schema()
    ->tableExists('i18n_string')) {
    $results = $this
      ->select('i18n_string', 'i18n')
      ->fields('i18n')
      ->condition('textgroup', 'menu')
      ->condition('type', 'item')
      ->condition('objectid', $mlid)
      ->execute()
      ->fetchAll();
    if ($results) {
      return TRUE;
    }
  }
  return FALSE;
}