public function MenuLinkTranslation::prepareRow in Drupal 9
Same name in this branch
- 9 core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php \Drupal\menu_link_content\Plugin\migrate\source\d6\MenuLinkTranslation::prepareRow()
- 9 core/modules/menu_link_content/src/Plugin/migrate/source/d7/MenuLinkTranslation.php \Drupal\menu_link_content\Plugin\migrate\source\d7\MenuLinkTranslation::prepareRow()
Same name and namespace in other branches
- 8 core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php \Drupal\menu_link_content\Plugin\migrate\source\d6\MenuLinkTranslation::prepareRow()
- 10 core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php \Drupal\menu_link_content\Plugin\migrate\source\d6\MenuLinkTranslation::prepareRow()
Adds additional data to the row.
Parameters
\Drupal\migrate\Row $row: The row object.
Return value
bool FALSE if this row needs to be skipped.
Overrides MenuLink::prepareRow
File
- core/
modules/ menu_link_content/ src/ Plugin/ migrate/ source/ d6/ MenuLinkTranslation.php, line 57
Class
- MenuLinkTranslation
- Gets Menu link translations from source database.
Namespace
Drupal\menu_link_content\Plugin\migrate\source\d6Code
public function prepareRow(Row $row) {
if (!parent::prepareRow($row)) {
return FALSE;
}
// Save the translation for this property.
$property_in_row = $row
->getSourceProperty('property');
// Set the i18n string table for use in I18nQueryTrait.
$this->i18nStringTable = static::I18N_STRING_TABLE;
// Get the translation for the property not already in the row and save it
// in the row.
$property_not_in_row = $property_in_row == 'title' ? 'description' : 'title';
return $this
->getPropertyNotInRowTranslation($row, $property_not_in_row, 'mlid', $this->idMap);
}