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: ...@@ -8,11 +8,11 @@ source:
destination: destination:
plugin: entity:node plugin: entity:node
default_bundle: article
process: process:
nid: nid nid: nid
title: title title: title
body: body
migration_dependencies: migration_dependencies:
required: {} required: {}
......
...@@ -27,7 +27,7 @@ class Article extends SqlBase ...@@ -27,7 +27,7 @@ class Article extends SqlBase
public function query() public function query()
{ {
$query = $this->select('node_field_data', 'ar') $query = $this->select('node_field_data', 'ar')
->fields('ar', ['nid','title','body']); ->fields('ar', ['nid','title']);
return $query; return $query;
...@@ -40,8 +40,7 @@ public function fields() ...@@ -40,8 +40,7 @@ public function fields()
{ {
$fields = [ $fields = [
'nid' => $this->t('nid'), 'nid' => $this->t('nid'),
'title' => $this->t('title'), 'title' => $this->t('title')
'body' => $this->t('body')
]; ];
return $fields; return $fields;
...@@ -63,11 +62,10 @@ public function getIds() ...@@ -63,11 +62,10 @@ public function getIds()
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
// public function prepareRow(Row $row) public function prepareRow(Row $row)
// { {
// $publish_date = $row->getSourceProperty('publish_date'); $nid = $row->getSourceProperty('nid');
// $new_date = date('Y-m-d\Th:i:s', strtotime($publish_date)); $row->setSourceProperty('nid', $nid);
// $row->setSourceProperty('publish_date', $new_date); return parent::prepareRow($row);
// 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