• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/crm/reader.php
  • Класс: BitrixImOpenLinesCrmReader
  • Вызов: Reader::getCompanies
private function getCompanies(): self
{
	BitrixMainTypeCollection::normalizeArrayValuesByInt($companyIds);
	if (empty($this->companyIds))
	{
		return $this;
	}

	$factory = ServiceContainer::getInstance()->getFactory(CCrmOwnerType::Company);
	if (!$factory)
	{
		throw new Exception('factory for ' . CCrmOwnerType::Company . ' not found');
	}
	$items = $factory->getItems([
		'filter' => [
			'@ID' => $companyIds,
		],
	]);
	foreach ($items as $item)
	{
		$compatibleData = $item->getCompatibleData();
		$this->companiesInfo[$item->getId()] = $compatibleData;
		if (isset($this->typedEntities[$item->getEntityTypeId()][$item->getId()]))
		{
			$this->result[$item->getEntityTypeId()][$item->getId()] = $compatibleData;
		}
		$this->multiFields[] = [
			'NAME' => CCrmOwnerType::CompanyName,
			'ID' => $item->getId(),
		];
	}

	return $this;
}