public function NodeType::prepareRow in Zircon Profile 8
Same name in this branch
- 8 core/modules/node/src/Plugin/migrate/source/d6/NodeType.php \Drupal\node\Plugin\migrate\source\d6\NodeType::prepareRow()
- 8 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
- 8.0 core/modules/node/src/Plugin/migrate/source/d6/NodeType.php \Drupal\node\Plugin\migrate\source\d6\NodeType::prepareRow()
Add 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 101 - Contains \Drupal\node\Plugin\migrate\source\d6\NodeType.
Class
- NodeType
- Drupal 6 Node types source from database.
Namespace
Drupal\node\Plugin\migrate\source\d6Code
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, array(
'promote',
'sticky',
));
$options = array();
foreach (array(
'promote',
'sticky',
'status',
'revision',
) as $item) {
$options[$item] = in_array($item, $source_options);
}
$row
->setSourceProperty('options', $options);
$submitted = isset($this->themeSettings['toggle_node_info_' . $type]) ? $this->themeSettings['toggle_node_info_' . $type] : FALSE;
$row
->setSourceProperty('display_submitted', $submitted);
return parent::prepareRow($row);
}