Commit e37b46e1 authored by Reena Raghavan's avatar Reena Raghavan

Modified Article.php and migrate_plus.migration.article.yml

parent 6b965e48
......@@ -8,11 +8,11 @@ source:
destination:
plugin: entity:node
default_bundle: article
process:
nid: nid
title: title
body: body
migration_dependencies:
required: {}
......
......@@ -27,7 +27,7 @@ class Article extends SqlBase
public function query()
{
$query = $this->select('node_field_data', 'ar')
->fields('ar', ['nid','title','body']);
->fields('ar', ['nid','title']);
return $query;
......@@ -40,8 +40,7 @@ public function fields()
{
$fields = [
'nid' => $this->t('nid'),
'title' => $this->t('title'),
'body' => $this->t('body')
'title' => $this->t('title')
];
return $fields;
......@@ -63,11 +62,10 @@ public function getIds()
/**
* {@inheritdoc}
*/
// public function prepareRow(Row $row)
// {
// $publish_date = $row->getSourceProperty('publish_date');
// $new_date = date('Y-m-d\Th:i:s', strtotime($publish_date));
// $row->setSourceProperty('publish_date', $new_date);
// return parent::prepareRow($row);
// }
public function prepareRow(Row $row)
{
$nid = $row->getSourceProperty('nid');
$row->setSourceProperty('nid', $nid);
return parent::prepareRow($row);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment