• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/component/imageinput.php
  • Класс: BitrixCatalogComponentImageInput
  • Вызов: ImageInput::getValues
private function getValues(): array
{
	if (isset($this->values))
	{
		return $this->values;
	}

	if ($this->getEntityId() <= 0)
	{
		return [];
	}

	$this->values = [];
	$photoCollection = $this->entity->getFrontImageCollection();
	if ($this->isMorePhotoEnabled())
	{
		foreach ($photoCollection as $item)
		{
			if ($item instanceof MorePhotoImage)
			{
				$propName = str_replace('n#IND#', $item->getPropertyValueId(), $this->getInputName());
				$this->values[$propName] = $item->getId();
			}
			else
			{
				$this->values[$item::CODE] = $item->getId();
			}
		}
	}
	else
	{
		$item = $photoCollection->getFrontImage();
		if ($item)
		{
			$this->values[$item::CODE] = $item->getId();
		}
	}

	return $this->values;
}