Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
rubrictable.php
1
<?php
2
namespace
Bitrix\Subscribe
;
3
4
use
Bitrix\Main\Localization\Loc
;
5
use
Bitrix\Main\ORM\Data\DataManager
;
6
use
Bitrix\Main\ORM\Fields
;
7
34
class
RubricTable
extends
DataManager
35
{
41
public
static
function
getTableName
()
42
{
43
return
'b_list_rubric'
;
44
}
45
51
public
static
function
getMap
()
52
{
53
return
[
54
new
Fields\IntegerField(
55
'ID'
,
56
[
57
'primary'
=>
true
,
58
'autocomplete'
=>
true
,
59
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_ID_FIELD'
),
60
]
61
),
62
new
Fields\StringField(
63
'LID'
,
64
[
65
'required'
=>
true
,
66
'validation'
=> [__CLASS__,
'validateLid'
],
67
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_LID_FIELD'
),
68
]
69
),
70
new
Fields\StringField(
71
'CODE'
,
72
[
73
'validation'
=> [__CLASS__,
'validateCode'
],
74
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_CODE_FIELD'
),
75
]
76
),
77
new
Fields\StringField(
78
'NAME'
,
79
[
80
'validation'
=> [__CLASS__,
'validateName'
],
81
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_NAME_FIELD'
),
82
]
83
),
84
new
Fields\TextField(
85
'DESCRIPTION'
,
86
[
87
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_DESCRIPTION_FIELD'
),
88
]
89
),
90
new
Fields\IntegerField(
91
'SORT'
,
92
[
93
'default'
=> 100,
94
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_SORT_FIELD'
),
95
]
96
),
97
new
Fields\BooleanField(
98
'ACTIVE'
,
99
[
100
'values'
=>[
'N'
,
'Y'
],
101
'default'
=>
'Y'
,
102
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_ACTIVE_FIELD'
),
103
]
104
),
105
new
Fields\BooleanField(
106
'AUTO'
,
107
[
108
'values'
=> [
'N'
,
'Y'
],
109
'default'
=>
'N'
,
110
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_AUTO_FIELD'
),
111
]
112
),
113
new
Fields\StringField(
114
'DAYS_OF_MONTH'
,
115
[
116
'validation'
=> [__CLASS__,
'validateDaysOfMonth'
],
117
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_DAYS_OF_MONTH_FIELD'
),
118
]
119
),
120
new
Fields\StringField(
121
'DAYS_OF_WEEK'
,
122
[
123
'validation'
=> [__CLASS__,
'validateDaysOfWeek'
],
124
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_DAYS_OF_WEEK_FIELD'
),
125
]
126
),
127
new
Fields\StringField(
128
'TIMES_OF_DAY'
,
129
[
130
'validation'
=> [__CLASS__,
'validateTimesOfDay'
],
131
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_TIMES_OF_DAY_FIELD'
),
132
]
133
),
134
new
Fields\StringField(
135
'TEMPLATE'
,
136
[
137
'validation'
=> [__CLASS__,
'validateTemplate'
],
138
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_TEMPLATE_FIELD'
),
139
]
140
),
141
new
Fields\DatetimeField(
142
'LAST_EXECUTED'
,
143
[
144
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_LAST_EXECUTED_FIELD'
),
145
]
146
),
147
new
Fields\BooleanField(
148
'VISIBLE'
,
149
[
150
'values'
=> [
'N'
,
'Y'
],
151
'default'
=>
'Y'
,
152
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_VISIBLE_FIELD'
),
153
]
154
),
155
new
Fields\StringField(
156
'FROM_FIELD'
,
157
[
158
'validation'
=> [__CLASS__,
'validateFromField'
],
159
'title'
=>
Loc::getMessage
(
'RUBRIC_ENTITY_FROM_FIELD_FIELD'
),
160
]
161
),
162
new
Fields\Relations\Reference
(
163
'SITE'
,
164
'\Bitrix\Main\Site'
,
165
[
'=this.LID'
=>
'ref.LID'
],
166
[
'join_type'
=>
'LEFT'
]
167
),
168
];
169
}
170
176
public
static
function
validateLid
(): array
177
{
178
return
[
179
new
Fields\Validators\LengthValidator
(
null
, 2),
180
];
181
}
182
188
public
static
function
validateCode
(): array
189
{
190
return
[
191
new
Fields\Validators\LengthValidator
(
null
, 100),
192
];
193
}
194
200
public
static
function
validateName
(): array
201
{
202
return
[
203
new
Fields\Validators\LengthValidator
(
null
, 100),
204
];
205
}
206
212
public
static
function
validateDaysOfMonth
(): array
213
{
214
return
[
215
new
Fields\Validators\LengthValidator
(
null
, 100),
216
];
217
}
218
224
public
static
function
validateDaysOfWeek
(): array
225
{
226
return
[
227
new
Fields\Validators\LengthValidator
(
null
, 15),
228
];
229
}
230
236
public
static
function
validateTimesOfDay
(): array
237
{
238
return
[
239
new
Fields\Validators\LengthValidator
(
null
, 255),
240
];
241
}
242
248
public
static
function
validateTemplate
(): array
249
{
250
return
[
251
new
Fields\Validators\LengthValidator
(
null
, 100),
252
];
253
}
254
260
public
static
function
validateFromField
(): array
261
{
262
return
[
263
new
Fields\Validators\LengthValidator
(
null
, 255),
264
];
265
}
266
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Fields\Relations\Reference
Definition
reference.php:26
Bitrix\Main\ORM\Fields\Validators\LengthValidator
Definition
lengthvalidator.php:19
Bitrix\Subscribe\RubricTable
Definition
rubrictable.php:35
Bitrix\Subscribe\RubricTable\getMap
static getMap()
Definition
rubrictable.php:51
Bitrix\Subscribe\RubricTable\validateDaysOfMonth
static validateDaysOfMonth()
Definition
rubrictable.php:212
Bitrix\Subscribe\RubricTable\validateFromField
static validateFromField()
Definition
rubrictable.php:260
Bitrix\Subscribe\RubricTable\validateLid
static validateLid()
Definition
rubrictable.php:176
Bitrix\Subscribe\RubricTable\validateDaysOfWeek
static validateDaysOfWeek()
Definition
rubrictable.php:224
Bitrix\Subscribe\RubricTable\validateName
static validateName()
Definition
rubrictable.php:200
Bitrix\Subscribe\RubricTable\validateTimesOfDay
static validateTimesOfDay()
Definition
rubrictable.php:236
Bitrix\Subscribe\RubricTable\validateTemplate
static validateTemplate()
Definition
rubrictable.php:248
Bitrix\Subscribe\RubricTable\getTableName
static getTableName()
Definition
rubrictable.php:41
Bitrix\Subscribe\RubricTable\validateCode
static validateCode()
Definition
rubrictable.php:188
Bitrix\Main\ORM\Fields
Definition
arrayfield.php:9
Bitrix\Subscribe
Definition
rubrictable.php:2
modules
subscribe
lib
rubrictable.php
Создано системой
1.10.0