22 foreach ($this->entities as $entity)
26 $popupData->merge($entity->getPopupData($options[
'POPUP_DATA_EXCLUDE'] ?? []));
30 if (isset($this->additionalPopupData))
32 $popupData->merge($this->additionalPopupData);
35 $rest = $popupData->toRestFormat($options);
39 if (count($this->entities) === 1)
41 return $this->entities[0]->toRestFormat($options);
45 foreach ($this->entities as $entity)
47 $rest[$entity::getRestEntityName()] = $entity->toRestFormat($options);