• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/ui/entityselector/entityprovider.php
  • Класс: Bitrix\Crm\Integration\UI\EntitySelector\EntityProvider
  • Вызов: EntityProvider::makeItem
protected function makeItem(int $entityId): ?Item
{
	$canReadItem = EntityAuthorization::checkReadPermission($this->getEntityTypeId(), $entityId);

	$entityInfo = \CCrmEntitySelectorHelper::PrepareEntityInfo(
		$this->getEntityTypeNameForMakeItemMethod(),
		$entityId,
		[
			'ENTITY_EDITOR_FORMAT' => true,
			'IS_HIDDEN' => !$canReadItem,
			'REQUIRE_REQUISITE_DATA' => true,
			'REQUIRE_MULTIFIELDS' => true,
			'NAME_TEMPLATE' => \Bitrix\Crm\Format\PersonNameFormatter::getFormat(),
			'REQUIRE_EDIT_REQUISITE_DATA' => $this->withRequisites,
			'LARGE_IMAGES' => true,
		]
	);

	return new Item([
		'id' => $entityId,
		'entityId' => $this->getItemEntityId(),
		'title' => (string)$entityInfo['title'],
		'subtitle' => $entityInfo['desc'],
		'link' => $entityInfo['url'],
		'linkTitle' => Loc::getMessage('CRM_COMMON_DETAIL'),
		'avatar' => $entityInfo['image'],
		'searchable' => true,
		'hidden' => !$canReadItem,
		'customData' => [
			'entityInfo' => $entityInfo
		],
	]);
}