8.5.x Comment.php Comment::prepareRow(Row $row)
8.5.x Comment.php Comment::prepareRow(Row $row)
8.0.x Comment.php Comment::prepareRow(Row $row)
8.0.x Comment.php Comment::prepareRow(Row $row)
8.1.x Comment.php Comment::prepareRow(Row $row)
8.1.x Comment.php Comment::prepareRow(Row $row)
8.2.x Comment.php Comment::prepareRow(Row $row)
8.2.x Comment.php Comment::prepareRow(Row $row)
8.3.x Comment.php Comment::prepareRow(Row $row)
8.3.x Comment.php Comment::prepareRow(Row $row)
8.4.x Comment.php Comment::prepareRow(Row $row)
8.4.x Comment.php Comment::prepareRow(Row $row)
8.6.x Comment.php Comment::prepareRow(Row $row)
8.6.x Comment.php Comment::prepareRow(Row $row)

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/d7/Comment.php, line 32

Class

Comment
Drupal 7 comment source from database.

Namespace

Drupal\comment\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {
  $cid = $row
    ->getSourceProperty('cid');
  $node_type = $row
    ->getSourceProperty('node_type');
  $comment_type = 'comment_node_' . $node_type;
  $row
    ->setSourceProperty('comment_type', 'comment_node_' . $node_type);
  foreach (array_keys($this
    ->getFields('comment', $comment_type)) as $field) {
    $row
      ->setSourceProperty($field, $this
      ->getFieldValues('comment', $field, $cid));
  }
  return parent::prepareRow($row);
}