Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
consent.php
1<?php
9
14use Bitrix\Crm\WebForm\Helper;
15
16Loc::loadMessages(__FILE__);
17
34class ConsentTable extends Entity\DataManager
35{
41 public static function getTableName()
42 {
43 return 'b_consent_user_consent';
44 }
45
52 public static function getMap()
53 {
54 return array(
55 'ID' => array(
56 'data_type' => 'integer',
57 'primary' => true,
58 'autocomplete' => true,
59 ),
60 'DATE_INSERT' => array(
61 'data_type' => 'datetime',
62 'required' => true,
63 'default_value' => new DateTime(),
64 ),
65 'AGREEMENT_ID' => array(
66 'data_type' => 'integer',
67 'required' => true,
68 ),
69 'USER_ID' => array(
70 'data_type' => 'integer',
71 ),
72 'IP' => array(
73 'data_type' => 'string',
74 'required' => true,
75 'validation' => function()
76 {
77 return [
78 function ($value)
79 {
80 return filter_var($value, FILTER_VALIDATE_IP) !== false;
81 }
82 ];
83 }
84 ),
85 'URL' => array(
86 'data_type' => 'string',
87 'required' => false,
88 ),
89 'ORIGIN_ID' => array(
90 'data_type' => 'string',
91 'required' => false,
92 ),
93 'ORIGINATOR_ID' => array(
94 'data_type' => 'string',
95 'required' => false,
96 ),
97 'USER' => array(
98 'data_type' => 'Bitrix\Main\UserTable',
99 'reference' => array('=this.USER_ID' => 'ref.ID'),
100 ),
101 (new OneToMany('ITEMS', UserConsentItemTable::class, 'USER_CONSENT'))
102 );
103 }
104}
static loadMessages($file)
Definition loc.php:64