2024-03-15 17:02:56 +02:00

16 lines
446 B
Plaintext

private function getFiles(NodeInterface $node, string $field): array {
$files = [];
foreach ($node->get($field)->getValue() as $value) {
$file = $this->entityTypeManager
->getStorage('file')
->load($value['target_id']);
if ($file) {
$url = $this->fileUrlGenerator
->generateAbsoluteString($file->getFileUri());
$files[] = array("url" => $url);
}
}
return $files;
}