• Модуль: highloadblock
  • Путь к файлу: ~/bitrix/modules/highloadblock/classes/general/cusertypehlblock.php
  • Класс: CUserTypeHlblock
  • Вызов: CUserTypeHlblock::getEntityReferences
static function getEntityReferences($userfield, BitrixMainEntityScalarField $entityField): array
{
	if ($userfield['SETTINGS']['HLBLOCK_ID'])
	{
		$hlblock = BitrixHighloadblockHighloadBlockTable::getById($userfield['SETTINGS']['HLBLOCK_ID'])->fetch();

		if ($hlblock)
		{
			if (class_exists($hlblock['NAME'].'Table'))
			{
				$hlentity = BitrixMainEntityBase::getInstance($hlblock['NAME']);
			}
			else
			{
				$hlentity = BitrixHighloadblockHighloadBlockTable::compileEntity($hlblock);
			}

			return [
				new BitrixMainEntityReferenceField(
					$entityField->getName().'_REF',
					$hlentity,
					['=this.'.$entityField->getName() => 'ref.ID']
				)
			];
		}
	}

	return array();
}