• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/observer/entity/observertable.php
  • Класс: Bitrix\Crm\Observer\Entity\ObserverTable
  • Вызов: ObserverTable::getMap
static function getMap(): array
{
	return [
		(new IntegerField('ENTITY_TYPE_ID'))
			->configurePrimary(),
		(new IntegerField('ENTITY_ID'))
			->configurePrimary(),
		(new IntegerField('USER_ID'))
			->configurePrimary(),
		(new IntegerField('SORT'))
			->configureRequired()
			->configureDefaultValue(0),
		(new DatetimeField('CREATED_TIME'))
			->configureRequired(),
		(new DatetimeField('LAST_UPDATED_TIME'))
			->configureRequired(),
		(new Main\ORM\Fields\Relations\Reference(
			'DEAL',
			DealTable::class,
			Join::on('this.ENTITY_ID', 'ref.ID')
				->where('this.ENTITY_TYPE_ID', \CCrmOwnerType::Deal)
		)),
		(new Main\ORM\Fields\Relations\Reference(
			'LEAD',
			LeadTable::class,
			Join::on('this.ENTITY_ID', 'ref.ID')
				->where('this.ENTITY_TYPE_ID', \CCrmOwnerType::Lead)
		)),
	];
}