15 lines
473 B
Plaintext
15 lines
473 B
Plaintext
private function getImages(NodeInterface $node, string $field): array {
|
|
$images = [];
|
|
foreach ($node->get($field)->getValue() as $value) {
|
|
$file = $this->entityTypeManager
|
|
->getStorage('file')
|
|
->load($value['target_id']);
|
|
if ($file) {
|
|
$url = $this->fileUrlGenerator
|
|
->generateAbsoluteString($file->getFileUri());
|
|
$images[] = array("url" => $url, "alt" => $value['alt']);
|
|
}
|
|
}
|
|
return $images;
|
|
}
|