• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/vk/vk.php
  • Класс: BitrixSaleTradingPlatformVkVk
  • Вызов: Vk::createCatalogField
private function createCatalogField($props)
{
	$result = array('RESULT' => true, 'VALUE' => '');

//		find existing props to exclude duplicates
	if ($existPropId = self::checkExistingCatalogField(
		$props['IBLOCK_ID'],
		self::createCodeForSectionFieldVkImage($props['IBLOCK_ID'])
	)
	)
	{
		$result['VALUE'] = $existPropId;
	}

//		if not exist - create new
	else
	{
		$ibp = new CIBlockProperty();
		$result['VALUE'] = (int)$ibp->Add($props);
		if ($result['VALUE'] <= 0)
		{
			$result['RESULT'] = false;
			$result['VALUE'] = $ibp->LAST_ERROR;
		}
	}

	return $result;
}