• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/userconsent/internals/consent.php
  • Класс: BitrixMainUserConsentInternalsConsentTable
  • Вызов: ConsentTable::getMap
static function getMap()
{
	return array(
		'ID' => array(
			'data_type' => 'integer',
			'primary' => true,
			'autocomplete' => true,
		),
		'DATE_INSERT' => array(
			'data_type' => 'datetime',
			'required' => true,
			'default_value' => new DateTime(),
		),
		'AGREEMENT_ID' => array(
			'data_type' => 'integer',
			'required' => true,
		),
		'USER_ID' => array(
			'data_type' => 'integer',
		),
		'IP' => array(
			'data_type' => 'string',
			'required' => true,
			'validation' => function()
			{
				return [
					function ($value)
					{
						return filter_var($value, FILTER_VALIDATE_IP) !== false;
					}
				];
			}
		),
		'URL' => array(
			'data_type' => 'string',
			'required' => false,
		),
		'ORIGIN_ID' => array(
			'data_type' => 'string',
			'required' => false,
		),
		'ORIGINATOR_ID' => array(
			'data_type' => 'string',
			'required' => false,
		),
		'USER' => array(
			'data_type' => 'BitrixMainUserTable',
			'reference' => array('=this.USER_ID' => 'ref.ID'),
		),
		(new OneToMany('ITEMS', UserConsentItemTable::class, 'USER_CONSENT'))
	);
}