Same name in this branch
  1. 10 core/modules/node/src/Plugin/migrate/source/d6/NodeType.php \Drupal\node\Plugin\migrate\source\d6\NodeType::prepareRow()
  2. 10 core/modules/node/src/Plugin/migrate/source/d7/NodeType.php \Drupal\node\Plugin\migrate\source\d7\NodeType::prepareRow()
Same name and namespace in other branches
  1. 8.9.x core/modules/node/src/Plugin/migrate/source/d6/NodeType.php \Drupal\node\Plugin\migrate\source\d6\NodeType::prepareRow()
  2. 9 core/modules/node/src/Plugin/migrate/source/d6/NodeType.php \Drupal\node\Plugin\migrate\source\d6\NodeType::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/node/src/Plugin/migrate/source/d6/NodeType.php, line 124

Class

NodeType
Drupal 6 Node types source from database.

Namespace

Drupal\node\Plugin\migrate\source\d6

Code

public function prepareRow(Row $row) {
  $row
    ->setSourceProperty('teaser_length', $this->teaserLength);
  $row
    ->setSourceProperty('node_preview', $this->nodePreview);
  $type = $row
    ->getSourceProperty('type');
  $source_options = $this
    ->variableGet('node_options_' . $type, [
    'promote',
    'sticky',
  ]);
  $options = [];
  foreach ([
    'promote',
    'sticky',
    'status',
    'revision',
  ] as $item) {
    $options[$item] = in_array($item, $source_options);
  }
  $row
    ->setSourceProperty('options', $options);
  $submitted = $this->themeSettings['toggle_node_info_' . $type] ?? FALSE;
  $row
    ->setSourceProperty('display_submitted', $submitted);
  if ($default_node_menu = $this
    ->variableGet('menu_default_node_menu', NULL)) {
    $row
      ->setSourceProperty('available_menus', [
      $default_node_menu,
    ]);
    $row
      ->setSourceProperty('parent', $default_node_menu . ':');
  }
  if ($this
    ->moduleExists('comment')) {
    foreach (array_keys($this
      ->getCommentFields()) as $field) {
      $row
        ->setSourceProperty($field, $this
        ->variableGet($field . '_' . $type, NULL));
    }
  }
  return parent::prepareRow($row);
}