• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/requisite/importhelper.php
  • Класс: Bitrix\Crm\Requisite\ImportHelper
  • Вызов: ImportHelper::getPresense
protected function getPresense($row)
{
	$result = array(
		'byGroup' => array(),
		'byCountry' => array()
	);

	foreach (array_keys($this->headerGroupCountryIdMap) as $groupName)
	{
		foreach ($this->headerGroupCountryIdMap[$groupName] as $countryId => $headerMap)
		{
			foreach (array_keys($headerMap) as $headerId)
			{
				$index = $this->headerIndex[$headerId];
				if (isset($row[$index]) && is_string($row[$index]) && $row[$index] <> ''
					&& !isset($result['byCountry'][$groupName][$countryId]))
				{
					if (!isset($result['byGroup'][$groupName]))
						$result['byGroup'][$groupName] = true;
					$result['byCountry'][$groupName][$countryId] = true;
					break;
				}
			}
		}
	}

	return $result;
}