• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/vk/map.php
  • Класс: BitrixSaleTradingPlatformVkMap
  • Вызов: Map::deleteAllMapping
static function deleteAllMapping()
{
//		GET all entity IDs
	$resEntityIds = MapEntityTable::getList(array(
		"filter" => array('%=CODE' => self::getGeneralCodePrefix() . '%'),
	));
	$entityIds = array();
	while ($entityId = $resEntityIds->fetch())
		$entityIds[] = $entityId['ID'];

//		DELETE all MAP ENTITY
	foreach ($entityIds as $entityId)
		MapEntityTable::delete($entityId);


//		GET all map items IDs
	$resMapIds = MapTable::getList(array(
		"filter" => array('=ENTITY_ID' => $entityIds),
	));
	$mapIds = array();
	while ($mapId = $resMapIds->fetch())
		$mapIds[] = $mapId['ID'];

//		DELETE all from MAP
	foreach ($mapIds as $mapId)
		MapTable::delete($mapId);
}