Deal::loadEntityValues

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Deal
  4. loadEntityValues
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/bizproc/document/valuecollection/deal.php
  • Класс: Bitrix\Crm\Integration\BizProc\Document\ValueCollection\Deal
  • Вызов: Deal::loadEntityValues
protected function loadEntityValues(): void
{
	if (isset($this->document['ID']))
	{
		return;
	}

	$result = \CCrmDeal::GetListEx(
		[],
		[
			'ID' => $this->id,
			'CHECK_PERMISSIONS' => 'N',
		],
		false,
		false,
		['*', 'UF_*']
	);

	$this->document = array_merge($this->document, $result->fetch() ?: []);

	$this->appendDefaultUserPrefixes();

	$categoryId = isset($this->document['CATEGORY_ID']) ? (int)$this->document['CATEGORY_ID'] : 0;
	$this->document['CATEGORY_ID_PRINTABLE'] = Crm\Category\DealCategory::getName($categoryId);

	$stageId = $this->document['STAGE_ID'] ?? '';
	$this->document['STAGE_ID_PRINTABLE'] = Crm\Category\DealCategory::getStageName($stageId, $categoryId);

	if ($this->document['COMPANY_ID'] <= 0)
	{
		$this->document['COMPANY_ID'] = null;
	}

	if ($this->document['CONTACT_ID'] <= 0)
	{
		$this->document['CONTACT_ID'] = null;
	}

	$this->loadUserFieldValues();

	$this->document = Crm\Entity\CommentsHelper::prepareFieldsFromBizProc($this->typeId, $this->id, $this->document);
}

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