Company::getPhone

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Company
  4. getPhone
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/catalog/contractor/company.php
  • Класс: Bitrix\Crm\Integration\Catalog\Contractor\Company
  • Вызов: Company::getPhone
public function getPhone(): ?string
{
	$result = null;

	$multiFields = $this->company->getFm()->getAll();
	foreach ($multiFields as $multiField)
	{
		if (
			$multiField->getTypeId() === Phone::ID
			&& $multiField->getValueType() === Phone::VALUE_TYPE_WORK
		)
		{
			$result = $multiField->getValue();
			break;
		}
	}

	return $result;
}

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