public function MenuLink::hasTranslation in Drupal 9
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 128
Class
- MenuLink
- Drupal menu link source from database.
Namespace
Drupal\menu_link_content\Plugin\migrate\sourceCode
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;
}