CommunicationStatistics::unregisterByOwner

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CommunicationStatistics
  4. unregisterByOwner
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/activity/communicationstatistics.php
  • Класс: Bitrix\Crm\Activity\CommunicationStatistics
  • Вызов: CommunicationStatistics::unregisterByOwner
static function unregisterByOwner($ownerTypeId, $ownerId)
{
	$ownerTypeId = (int)$ownerTypeId;
	$ownerId = (int)$ownerId;

	if ($ownerTypeId === \CCrmOwnerType::Company)
	{
		Statistics\CompanyActivityMarkStatisticEntry::unregister($ownerId);
		Statistics\CompanyActivityStatisticEntry::unregister($ownerId);
		Statistics\CompanyActivityStatusStatisticEntry::unregister($ownerId);
		Statistics\CompanyActivityStreamStatisticEntry::unregister($ownerId);
		Statistics\CompanyActivitySumStatisticEntry::unregister($ownerId);

	}
	elseif ($ownerTypeId === \CCrmOwnerType::Contact)
	{
		Statistics\ContactActivityStatisticEntry::unregister($ownerId);
		Statistics\ContactActivityMarkStatisticEntry::unregister($ownerId);
		Statistics\ContactActivityStatusStatisticEntry::unregister($ownerId);
		Statistics\ContactActivityStreamStatisticEntry::unregister($ownerId);
		Statistics\ContactActivitySumStatisticEntry::unregister($ownerId);
	}

	return true;
}

Добавить комментарий