Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
subscriptiontable.php
1<?php
2namespace Bitrix\Subscribe;
3
7
30{
36 public static function getTableName()
37 {
38 return 'b_subscription';
39 }
40
46 public static function getMap()
47 {
48 return [
49 new Fields\IntegerField(
50 'ID',
51 [
52 'primary' => true,
53 'autocomplete' => true,
54 'title' => Loc::getMessage('SUBSCRIPTION_ENTITY_ID_FIELD'),
55 ]
56 ),
57 new Fields\DatetimeField(
58 'DATE_INSERT',
59 [
60 'required' => true,
61 'title' => Loc::getMessage('SUBSCRIPTION_ENTITY_DATE_INSERT_FIELD'),
62 ]
63 ),
64 new Fields\DatetimeField(
65 'DATE_UPDATE',
66 [
67 'title' => Loc::getMessage('SUBSCRIPTION_ENTITY_DATE_UPDATE_FIELD'),
68 ]
69 ),
70 new Fields\IntegerField(
71 'USER_ID',
72 [
73 'title' => Loc::getMessage('SUBSCRIPTION_ENTITY_USER_ID_FIELD'),
74 ]
75 ),
76 new Fields\BooleanField(
77 'ACTIVE',
78 [
79 'values' => ['N', 'Y'],
80 'default' => 'Y',
81 'title' => Loc::getMessage('SUBSCRIPTION_ENTITY_ACTIVE_FIELD'),
82 ]
83 ),
84 new Fields\StringField(
85 'EMAIL',
86 [
87 'required' => true,
88 'validation' => [__CLASS__, 'validateEmail'],
89 'title' => Loc::getMessage('SUBSCRIPTION_ENTITY_EMAIL_FIELD'),
90 ]
91 ),
92 new Fields\StringField(
93 'FORMAT',
94 [
95 'default' => 'text',
96 'validation' => [__CLASS__, 'validateFormat'],
97 'title' => Loc::getMessage('SUBSCRIPTION_ENTITY_FORMAT_FIELD'),
98 ]
99 ),
100 new Fields\StringField(
101 'CONFIRM_CODE',
102 [
103 'validation' => [__CLASS__, 'validateConfirmCode'],
104 'title' => Loc::getMessage('SUBSCRIPTION_ENTITY_CONFIRM_CODE_FIELD'),
105 ]
106 ),
107 new Fields\BooleanField(
108 'CONFIRMED',
109 [
110 'values' => ['N', 'Y'],
111 'default' => 'N',
112 'title' => Loc::getMessage('SUBSCRIPTION_ENTITY_CONFIRMED_FIELD'),
113 ]
114 ),
115 new Fields\DatetimeField(
116 'DATE_CONFIRM',
117 [
118 'required' => true,
119 'title' => Loc::getMessage('SUBSCRIPTION_ENTITY_DATE_CONFIRM_FIELD'),
120 ]
121 ),
123 'USER',
124 'Bitrix\Main\User',
125 ['=this.USER_ID' => 'ref.ID'],
126 ['join_type' => 'LEFT']
127 ),
128 (new Fields\Relations\ManyToMany('RUBRICS', \Bitrix\Subscribe\RubricTable::class))
129 ->configureMediatorTableName('b_subscription_rubric')
130 ->configureLocalPrimary('ID', 'SUBSCRIPTION_ID', 'LIST_RUBRIC_ID')
131 ->configureRemotePrimary('ID', 'LIST_RUBRIC_ID')
132 ,
133 ];
134 }
135
141 public static function validateEmail(): array
142 {
143 return [
145 ];
146 }
147
153 public static function validateFormat(): array
154 {
155 return [
157 ];
158 }
159
165 public static function validateConfirmCode(): array
166 {
167 return [
169 ];
170 }
171}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29