• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/statistics/dealchannelstatisticentry.php
  • Класс: Bitrix\Crm\Statistics\DealChannelStatisticEntry
  • Вызов: DealChannelStatisticEntry::get
static function get($ownerID, $channelTypeID)
{
	if(!is_int($ownerID))
	{
		$ownerID = (int)$ownerID;
	}

	if($ownerID <= 0)
	{
		throw new Main\ArgumentException('Owner ID must be greater than zero.', 'ownerID');
	}


	$query = new Query(DealChannelStatisticsTable::getEntity());
	$query->addSelect('*');
	$query->addFilter('=OWNER_ID', $ownerID);
	$query->addFilter('=CHANNEL_TYPE_ID', $channelTypeID);
	$query->setLimit(1);

	$dbResult = $query->exec();
	$result = $dbResult->fetch();
	return is_array($result) ? $result : null;
}