Skip to content

Commit

Permalink
LOYALIST-58 Add body, left join only
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Jul 11, 2024
1 parent e59a31c commit f574a7c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ process:
bundle_key: vid
bundle: subject_heading
value_key: name
field_other_numbers/value: field_other_numbers_value
field_other_numbers/format:
plugin: default_value
default_value: 'wysiwyg'
body/value: body
body/format:
plugin: default_value
default_value: 'wysiwyg'

destination:
plugin: 'entity:node'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,22 @@ public function query()
$query->addField('n', 'nid', 'nid');
$query->addField('n', 'title', 'title');

$query->join('field_data_field_accompanying_record', 'fac', 'n.nid = fac.entity_id AND fac.deleted = 0');
$query->leftJoin('field_data_body', 'fbody', 'n.nid = fbody.entity_id AND fbody.deleted = 0');
$query->addField('fbody', 'body_value', 'body');

$query->leftJoin('field_data_field_accompanying_record', 'fac', 'n.nid = fac.entity_id AND fac.deleted = 0');
$query->addField('fac', 'field_accompanying_record_value', 'field_accompanying_record_value');

$query->join('field_data_field_issuing_body', 'fib', 'n.nid = fib.entity_id AND fib.deleted = 0');
$query->join('taxonomy_term_data', 'ttdfib', 'fib.field_issuing_body_tid = ttdfib.tid');
$query->leftJoin('field_data_field_other_numbers', 'fon', 'n.nid = fon.entity_id AND fon.deleted = 0');
$query->addField('fon', 'field_other_numbers_value', 'field_other_numbers_value');
$query->addField('fon', 'field_other_numbers_format', 'field_other_numbers_format');

$query->leftJoin('field_data_field_issuing_body', 'fib', 'n.nid = fib.entity_id AND fib.deleted = 0');
$query->leftJoin('taxonomy_term_data', 'ttdfib', 'fib.field_issuing_body_tid = ttdfib.tid');
$query->addField('ttdfib', 'name', 'issuing_body_name');

$query->join('field_data_field_subject_heading', 'fsh', 'n.nid = fsh.entity_id AND fsh.deleted = 0');
$query->join('taxonomy_term_data', 'ttdfsh', 'fsh.field_subject_heading_tid = ttdfsh.tid');
$query->leftJoin('field_data_field_subject_heading', 'fsh', 'n.nid = fsh.entity_id AND fsh.deleted = 0');
$query->leftJoin('taxonomy_term_data', 'ttdfsh', 'fsh.field_subject_heading_tid = ttdfsh.tid');
$query->addField('ttdfsh', 'name', 'subject_heading_name');

return $query;
Expand All @@ -51,6 +58,8 @@ public function fields()
'field_accompanying_record_value' => 'field_accompanying_record_value',
'issuing_body_name' => 'issuing_body_name',
'subject_heading_name' => 'subject_heading_name',
'field_other_numbers_value' => 'field_other_numbers_value',
'field_other_numbers_format' => 'field_other_numbers_format',
];
return $fields;
}
Expand Down

0 comments on commit f574a7c

Please sign in to comment.