• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/tracking/channel/collection.php
  • Класс: Bitrix\Crm\Tracking\Channel\Collection
  • Вызов: Collection::getSourceId
public function getSourceId()
{
	$this->rewind();
	$firstChannel = $this->current();
	if (!$firstChannel)
	{
		return null;
	}

	/** @var Base $firstChannel */
	if ($firstChannel->isSourceDirectlyRequiredSingleChannel())
	{
		return $firstChannel->getSourceId();
	}

	foreach ($this->values as $channel)
	{
		/** @var Base $channel */
		if ($channel->isSourceDirectlyRequiredSingleChannel())
		{
			continue;
		}

		$sourceId = $channel->getSourceId();
		if ($sourceId)
		{
			return $sourceId;
		}
	}

	return null;
}