• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/component/baseform.php
  • Класс: BitrixCatalogComponentBaseForm
  • Вызов: BaseForm::getImageValuesForEntity
private function getImageValuesForEntity(BaseIblockElementEntity $entity): array
{
	$values = [];

	if ($entity instanceof HasPropertyCollection)
	{
		$morePhotoProperty = $entity->getPropertyCollection()->findByCode(self::MORE_PHOTO);
		if ($morePhotoProperty)
		{
			$morePhotoValues = $morePhotoProperty->getPropertyValueCollection()->getValues();
			if (!empty($morePhotoValues))
			{
				if (!is_array($morePhotoValues))
				{
					$morePhotoValues = [$morePhotoValues];
				}
				$values = array_merge($values, $morePhotoValues);
			}
		}
	}

	$previewPicture = $entity->getField('PREVIEW_PICTURE');
	if ($previewPicture)
	{
		$values = array_merge([$previewPicture], $values);
	}

	$detailPicture = $entity->getField('DETAIL_PICTURE');
	if ($detailPicture)
	{
		$values = array_merge([$detailPicture], $values);
	}

	return $values;
}