public function MenuLinkLocalized::prepareRow in Drupal 10
Same name and namespace in other branches
- 9 core/modules/menu_link_content/src/Plugin/migrate/source/d7/MenuLinkLocalized.php \Drupal\menu_link_content\Plugin\migrate\source\d7\MenuLinkLocalized::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/ d7/ MenuLinkLocalized.php, line 43  
Class
- MenuLinkLocalized
 - Drupal 7 localized menu link translations source from database.
 
Namespace
Drupal\menu_link_content\Plugin\migrate\source\d7Code
public function prepareRow(Row $row) {
  $row
    ->setSourceProperty('skip_source_translation', TRUE);
  // Get the mlid for the source menu_link.
  $source_mlid = $this
    ->select('menu_links', 'ml')
    ->fields('ml', [
    'mlid',
  ])
    ->condition('i18n_tsid', $row
    ->getSourceProperty('i18n_tsid'))
    ->orderBy('mlid')
    ->range(0, 1)
    ->execute()
    ->fetchField();
  if ($source_mlid == $row
    ->getSourceProperty('mlid')) {
    $row
      ->setSourceProperty('skip_source_translation', FALSE);
  }
  $row
    ->setSourceProperty('mlid', $source_mlid);
  return parent::prepareRow($row);
}