• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/v2/Image/MorePhotoImage.php
  • Класс: BitrixCatalogv2ImageMorePhotoImage
  • Вызов: MorePhotoImage::setFileStructure
public function setFileStructure(array $fileFields): BaseImage
{
	parent::setFileStructure($fileFields);

	/** @var BaseIblockElementEntity $parent */
	if ($parent = $this->getParent())
	{
		$property = $parent->getPropertyCollection()->findByCode(self::CODE);
		if ($property)
		{
			/** @var BitrixCatalogv2PropertyValuePropertyValue $item */
			$item = $property->getPropertyValueCollection()->findByValue($this->getId());

			if ($item)
			{
				$item->setValue($this->getFileStructure());
			}
			else
			{
				$values = $property->getPropertyValueCollection()->getValues();
				$values[] = $this->getFileStructure();
				$property->getPropertyValueCollection()->setValues($values);
			}
		}
	}

	return $this;
}