File tree Expand file tree Collapse file tree 3 files changed +69
-2
lines changed
web/modules/custom/sfgov_api/src/Plugin/SfgApi Expand file tree Collapse file tree 3 files changed +69
-2
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ public function setCustomData($entity) {
29
29
'description ' => $ entity ->get ('field_description ' )->value ,
30
30
'data_dashboard ' => $ this ->getReferencedData ($ entity ->get ('field_data_dashboard ' )->referencedEntities ()),
31
31
'introductory_text ' => $ this ->getReferencedData ($ entity ->get ('field_introductory_text ' )->referencedEntities ()),
32
- // 'documents' => $this->getReferencedData($entity->get('field_paragraphs')->referencedEntities()), // needs to be created in wagtail
33
- // 'custom_section' => $this->getReferencedData($entity->get('field_content_bottom')->referencedEntities()), // needs to be updated in wagtail
32
+ 'documents ' => $ this ->getReferencedData ($ entity ->get ('field_paragraphs ' )->referencedEntities ()), // needs to be created in wagtail
33
+ 'custom_section ' => $ this ->getReferencedData ($ entity ->get ('field_content_bottom ' )->referencedEntities ()), // needs to be updated in wagtail
34
34
'related_agencies ' => $ this ->getReferencedEntity ($ entity ->get ('field_departments ' )->referencedEntities ()),
35
35
'related_topics ' => $ this ->getReferencedEntity ($ entity ->get ('field_topics ' )->referencedEntities ()),
36
36
];
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Drupal \sfgov_api \Plugin \SfgApi \Paragraph ;
4
+
5
+ use Drupal \sfgov_api \Plugin \SfgApi \ApiFieldHelperTrait ;
6
+
7
+ /**
8
+ * Plugin implementation of the sfgov_api.
9
+ *
10
+ * @SfgApi(
11
+ * id = "paragraph_data_story_reference_section",
12
+ * title = @Translation("Paragraph data_story_reference_section"),
13
+ * bundle = "data_story_reference_section",
14
+ * wag_bundle = "data_story_reference_section",
15
+ * entity_id = {},
16
+ * langcode = {},
17
+ * shape = {},
18
+ * )
19
+ */
20
+ class DataStoryReferenceSection extends SfgApiParagraphBase {
21
+
22
+ use ApiFieldHelperTrait;
23
+
24
+ /**
25
+ * {@inheritDoc}
26
+ */
27
+ public function setCustomData ($ entity ) {
28
+ return [
29
+ 'content ' => $ this ->getReferencedData ($ entity ->get ('field_content ' )->referencedEntities ()),
30
+ ];
31
+ }
32
+
33
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Drupal \sfgov_api \Plugin \SfgApi \Paragraph ;
4
+
5
+ use Drupal \sfgov_api \Plugin \SfgApi \ApiFieldHelperTrait ;
6
+
7
+ /**
8
+ * Plugin implementation of the sfgov_api.
9
+ *
10
+ * @SfgApi(
11
+ * id = "paragraph_data_story_reference_subsection",
12
+ * title = @Translation("Paragraph data_story_reference_subsection"),
13
+ * bundle = "data_story_reference_subsection",
14
+ * wag_bundle = "data_story_reference_subsection",
15
+ * entity_id = {},
16
+ * langcode = {},
17
+ * shape = {},
18
+ * )
19
+ */
20
+ class DataStoryReferenceSubSection extends SfgApiParagraphBase {
21
+
22
+ use ApiFieldHelperTrait;
23
+
24
+ /**
25
+ * {@inheritDoc}
26
+ */
27
+ public function setCustomData ($ entity ) {
28
+ return [
29
+ 'resources ' => $ this ->getReferencedData ($ entity ->get ('field_data_story ' )->referencedEntities ()),
30
+ 'title ' => $ entity ->get ('field_title ' )->value ,
31
+ ];
32
+ }
33
+
34
+ }
You can’t perform that action at this time.
0 commit comments