Skip to content

Commit

Permalink
LOYALIST-58 Add subject heading
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSanford committed Jul 11, 2024
1 parent 14bee3f commit e59a31c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ process:
bundle_key: vid
bundle: issuing_body
value_key: name
field_subject_heading:
-
plugin: entity_generate
source: subject_heading_name
entity_type: taxonomy_term
bundle_key: vid
bundle: subject_heading
value_key: name

destination:
plugin: 'entity:node'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@ public function query()
{
$query = $this->select('node', 'n');
$query->condition('n.type', 'loyalist_record');
$query->join('field_data_field_accompanying_record', 'fac', 'n.nid = fac.entity_id AND fac.deleted = 0');
$query->join('field_data_field_issuing_body', 'fib', 'n.nid = fib.entity_id AND fib.deleted = 0');
$query->join('taxonomy_term_data', 'ttd', 'fib.field_issuing_body_tid = ttd.tid');

$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->addField('fac', 'field_accompanying_record_value', 'field_accompanying_record_value');
$query->addField('ttd', 'name', 'issuing_body_name');

$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->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->addField('ttdfsh', 'name', 'subject_heading_name');

return $query;
}

Expand All @@ -44,6 +50,7 @@ public function fields()
'title' => 'title',
'field_accompanying_record_value' => 'field_accompanying_record_value',
'issuing_body_name' => 'issuing_body_name',
'subject_heading_name' => 'subject_heading_name',
];
return $fields;
}
Expand Down

0 comments on commit e59a31c

Please sign in to comment.