You are here

public function Comment::prepareRow in Drupal 9

Same name in this branch
  1. 9 core/modules/comment/src/Plugin/migrate/source/d6/Comment.php \Drupal\comment\Plugin\migrate\source\d6\Comment::prepareRow()
  2. 9 core/modules/comment/src/Plugin/migrate/source/d7/Comment.php \Drupal\comment\Plugin\migrate\source\d7\Comment::prepareRow()
Same name and namespace in other branches
  1. 8 core/modules/comment/src/Plugin/migrate/source/d6/Comment.php \Drupal\comment\Plugin\migrate\source\d6\Comment::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 SourcePluginBase::prepareRow

File

core/modules/comment/src/Plugin/migrate/source/d6/Comment.php, line 41

Class

Comment
Drupal 6 comment source from database.

Namespace

Drupal\comment\Plugin\migrate\source\d6

Code

public function prepareRow(Row $row) {

  // In D6, status=0 means published, while in D8 means the opposite.
  $row
    ->setSourceProperty('status', !$row
    ->getSourceProperty('status'));

  // If node did not have a language, use site default language as a fallback.
  if (!$row
    ->getSourceProperty('language')) {
    $language_default = $this
      ->variableGet('language_default', NULL);
    $language = $language_default ? $language_default->language : 'en';
    $row
      ->setSourceProperty('language', $language);
  }
  return parent::prepareRow($row);
}