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; }