We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f93976 commit d319980Copy full SHA for d319980
web/modules/custom/sfgov_api/src/Plugin/SfgApi/Media/File.php
@@ -25,9 +25,13 @@ class File extends SfgApiMediaBase {
25
* {@inheritDoc}
26
*/
27
public function setCustomData($entity) {
28
+ $referenced_file = $entity->get('field_media_file')->referencedEntities()[0];
29
+ $drupal_direct_url = isset($referenced_file) ? $referenced_file->createFileUrl() : NULL;
30
$custom_data = [
31
'description' => $entity->get('field_description')->value ?: '',
32
'published_date' => $entity->get('field_published_date')->value ?: NULL,
33
+ 'drupal_indirect_url' => $entity->toUrl()->toString(),
34
+ 'drupal_direct_url' => $drupal_direct_url,
35
];
36
return $custom_data;
37
}
0 commit comments