• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tradingplatform/vk/vkexporteddata.php
  • Класс: BitrixSaleTradingPlatformVkVkExportedData
  • Вызов: VkExportedData::addData
public function addData($newData)
{
	$cacheManager = Application::getInstance()->getManagedCache();

//		get saved data from cache, if exist...
	if ($cacheManager->read(self::CACHE_TTL, $this->cacheId))
		$savedData = $cacheManager->get($this->cacheId);

//		...or from VK
	else
		$savedData = $this->getDataFromVk();

//		add new data to existing
	$dataToSave = $savedData + $newData;
	$cacheManager->clean($this->cacheId);
	$cacheManager->read(self::CACHE_TTL, $this->cacheId);
	$cacheManager->set($this->cacheId, $dataToSave);
}