Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
sectiontable.php
1
<?php
2
3
namespace
Bitrix\Calendar\Internals
;
4
5
use
Bitrix\Main
;
6
use
Bitrix\Main\Localization\Loc
;
7
use
Bitrix\Main\ORM\Fields\BooleanField
;
8
use
Bitrix\Main\ORM\Fields\DatetimeField
;
9
use
Bitrix\Main\ORM\Fields\IntegerField
;
10
use
Bitrix\Main\ORM\Fields\StringField
;
11
use
Bitrix\Main\ORM\Fields\TextField
;
12
use
Bitrix\Main\ORM\Fields\Validators\LengthValidator
;
13
62
class
SectionTable
extends
Main\Entity\DataManager
63
{
69
public
static
function
getTableName
()
70
{
71
return
'b_calendar_section'
;
72
}
73
79
public
static
function
getMap
()
80
{
81
return
[
82
(
new
IntegerField
(
'ID'
))
83
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_ID_FIELD'
))
84
->configurePrimary(
true
)
85
->configureAutocomplete(
true
)
86
,
87
(
new
StringField
(
'NAME'
,
88
[
89
'validation'
=> [__CLASS__,
'validateName'
]
90
]
91
))
92
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_NAME_FIELD'
))
93
,
94
(
new
StringField
(
'XML_ID'
,
95
[
96
'validation'
=> [__CLASS__,
'validateXmlId'
]
97
]
98
))
99
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_XML_ID_FIELD'
))
100
,
101
(
new
StringField
(
'EXTERNAL_ID'
,
102
[
103
'validation'
=> [__CLASS__,
'validateExternalId'
]
104
]
105
))
106
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_EXTERNAL_ID_FIELD'
))
107
,
108
(
new
StringField
(
'GAPI_CALENDAR_ID'
,
109
[
110
'validation'
=> [__CLASS__,
'validateGapiCalendarId'
]
111
]
112
))
113
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_GAPI_CALENDAR_ID_FIELD'
))
114
,
115
(
new
BooleanField
(
'ACTIVE'
))
116
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_ACTIVE_FIELD'
))
117
->configureValues(
'N'
,
'Y'
)
118
->configureDefaultValue(
'Y'
)
119
,
120
(
new
TextField
(
'DESCRIPTION'
))
121
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_DESCRIPTION_FIELD'
))
122
,
123
(
new
StringField
(
'COLOR'
,
124
[
125
'validation'
=> [__CLASS__,
'validateColor'
]
126
]
127
))
128
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_COLOR_FIELD'
))
129
,
130
(
new
StringField
(
'TEXT_COLOR'
,
131
[
132
'validation'
=> [__CLASS__,
'validateTextColor'
]
133
]
134
))
135
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_TEXT_COLOR_FIELD'
))
136
,
137
(
new
StringField
(
'EXPORT'
,
138
[
139
'validation'
=> [__CLASS__,
'validateExport'
]
140
]
141
))
142
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_EXPORT_FIELD'
))
143
,
144
(
new
IntegerField
(
'SORT'
))
145
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_SORT_FIELD'
))
146
->configureDefaultValue(100)
147
,
148
(
new
StringField
(
'CAL_TYPE'
,
149
[
150
'validation'
=> [__CLASS__,
'validateCalType'
]
151
]
152
))
153
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_CAL_TYPE_FIELD'
))
154
,
155
(
new
IntegerField
(
'OWNER_ID'
))
156
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_OWNER_ID_FIELD'
))
157
,
158
(
new
IntegerField
(
'CREATED_BY'
))
159
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_CREATED_BY_FIELD'
))
160
->configureRequired(
true
)
161
,
162
(
new
IntegerField
(
'PARENT_ID'
))
163
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_PARENT_ID_FIELD'
))
164
,
165
(
new
DatetimeField
(
'DATE_CREATE'
))
166
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_DATE_CREATE_FIELD'
))
167
,
168
(
new
DatetimeField
(
'TIMESTAMP_X'
))
169
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_TIMESTAMP_X_FIELD'
))
170
,
171
(
new
StringField
(
'DAV_EXCH_CAL'
,
172
[
173
'validation'
=> [__CLASS__,
'validateDavExchCal'
]
174
]
175
))
176
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_DAV_EXCH_CAL_FIELD'
))
177
,
178
(
new
StringField
(
'DAV_EXCH_MOD'
,
179
[
180
'validation'
=> [__CLASS__,
'validateDavExchMod'
]
181
]
182
))
183
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_DAV_EXCH_MOD_FIELD'
))
184
,
185
(
new
StringField
(
'CAL_DAV_CON'
,
186
[
187
'validation'
=> [__CLASS__,
'validateCalDavCon'
]
188
]
189
))
190
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_CAL_DAV_CON_FIELD'
))
191
,
192
(
new
StringField
(
'CAL_DAV_CAL'
,
193
[
194
'validation'
=> [__CLASS__,
'validateCalDavCal'
]
195
]
196
))
197
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_CAL_DAV_CAL_FIELD'
))
198
,
199
(
new
StringField
(
'CAL_DAV_MOD'
,
200
[
201
'validation'
=> [__CLASS__,
'validateCalDavMod'
]
202
]
203
))
204
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_CAL_DAV_MOD_FIELD'
))
205
,
206
(
new
StringField
(
'IS_EXCHANGE'
,
207
[
208
'validation'
=> [__CLASS__,
'validateIsExchange'
]
209
]
210
))
211
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_IS_EXCHANGE_FIELD'
))
212
,
213
(
new
StringField
(
'SYNC_TOKEN'
,
214
[
215
'validation'
=> [__CLASS__,
'validateSyncToken'
]
216
]
217
))
218
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_SYNC_TOKEN_FIELD'
))
219
,
220
(
new
StringField
(
'PAGE_TOKEN'
,
221
[
222
'validation'
=> [__CLASS__,
'validatePageToken'
]
223
]
224
))
225
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_PAGE_TOKEN_FIELD'
))
226
,
227
(
new
StringField
(
'EXTERNAL_TYPE'
,
228
[
229
'validation'
=> [__CLASS__,
'validateExternalType'
]
230
]
231
))
232
->configureTitle(
Loc::getMessage
(
'SECTION_ENTITY_EXTERNAL_TYPE_FIELD'
))
233
,
234
];
235
}
236
242
public
static
function
validateName
(): array
243
{
244
return
[
245
new
LengthValidator
(
null
, 255),
246
];
247
}
248
254
public
static
function
validateXmlId
(): array
255
{
256
return
[
257
new
LengthValidator
(
null
, 100),
258
];
259
}
260
266
public
static
function
validateExternalId
(): array
267
{
268
return
[
269
new
LengthValidator
(
null
, 100),
270
];
271
}
272
278
public
static
function
validateGapiCalendarId
(): array
279
{
280
return
[
281
new
LengthValidator
(
null
, 255),
282
];
283
}
284
290
public
static
function
validateColor
(): array
291
{
292
return
[
293
new
LengthValidator
(
null
, 10),
294
];
295
}
296
302
public
static
function
validateTextColor
(): array
303
{
304
return
[
305
new
LengthValidator
(
null
, 10),
306
];
307
}
308
314
public
static
function
validateExport
(): array
315
{
316
return
[
317
new
LengthValidator
(
null
, 255),
318
];
319
}
320
326
public
static
function
validateCalType
(): array
327
{
328
return
[
329
new
LengthValidator
(
null
, 100),
330
];
331
}
332
338
public
static
function
validateDavExchCal
(): array
339
{
340
return
[
341
new
LengthValidator
(
null
, 255),
342
];
343
}
344
350
public
static
function
validateDavExchMod
(): array
351
{
352
return
[
353
new
LengthValidator
(
null
, 255),
354
];
355
}
356
362
public
static
function
validateCalDavCon
(): array
363
{
364
return
[
365
new
LengthValidator
(
null
, 255),
366
];
367
}
368
374
public
static
function
validateCalDavCal
(): array
375
{
376
return
[
377
new
LengthValidator
(
null
, 255),
378
];
379
}
380
386
public
static
function
validateCalDavMod
(): array
387
{
388
return
[
389
new
LengthValidator
(
null
, 255),
390
];
391
}
392
398
public
static
function
validateIsExchange
(): array
399
{
400
return
[
401
new
LengthValidator
(
null
, 1),
402
];
403
}
404
410
public
static
function
validateSyncToken
(): array
411
{
412
return
[
413
new
LengthValidator
(
null
, 255),
414
];
415
}
416
422
public
static
function
validatePageToken
(): array
423
{
424
return
[
425
new
LengthValidator
(
null
, 255),
426
];
427
}
428
434
public
static
function
validateExternalType
(): array
435
{
436
return
[
437
new
LengthValidator
(
null
, 20),
438
];
439
}
440
}
Bitrix\Calendar\Internals\SectionTable\validateCalDavMod
static validateCalDavMod()
Definition
sectiontable.php:386
Bitrix\Calendar\Internals\SectionTable\validateSyncToken
static validateSyncToken()
Definition
sectiontable.php:410
Bitrix\Calendar\Internals\SectionTable\validateIsExchange
static validateIsExchange()
Definition
sectiontable.php:398
Bitrix\Calendar\Internals\SectionTable\getMap
static getMap()
Definition
sectiontable.php:79
Bitrix\Calendar\Internals\SectionTable\validateCalDavCal
static validateCalDavCal()
Definition
sectiontable.php:374
Bitrix\Calendar\Internals\SectionTable\validateExport
static validateExport()
Definition
sectiontable.php:314
Bitrix\Calendar\Internals\SectionTable\validateDavExchCal
static validateDavExchCal()
Definition
sectiontable.php:338
Bitrix\Calendar\Internals\SectionTable\validateExternalId
static validateExternalId()
Definition
sectiontable.php:266
Bitrix\Calendar\Internals\SectionTable\validateCalType
static validateCalType()
Definition
sectiontable.php:326
Bitrix\Calendar\Internals\SectionTable\validateGapiCalendarId
static validateGapiCalendarId()
Definition
sectiontable.php:278
Bitrix\Calendar\Internals\SectionTable\validateXmlId
static validateXmlId()
Definition
sectiontable.php:254
Bitrix\Calendar\Internals\SectionTable\validateCalDavCon
static validateCalDavCon()
Definition
sectiontable.php:362
Bitrix\Calendar\Internals\SectionTable\validateExternalType
static validateExternalType()
Definition
sectiontable.php:434
Bitrix\Calendar\Internals\SectionTable\validatePageToken
static validatePageToken()
Definition
sectiontable.php:422
Bitrix\Calendar\Internals\SectionTable\validateDavExchMod
static validateDavExchMod()
Definition
sectiontable.php:350
Bitrix\Calendar\Internals\SectionTable\validateName
static validateName()
Definition
sectiontable.php:242
Bitrix\Calendar\Internals\SectionTable\validateTextColor
static validateTextColor()
Definition
sectiontable.php:302
Bitrix\Calendar\Internals\SectionTable\getTableName
static getTableName()
Definition
sectiontable.php:69
Bitrix\Calendar\Internals\SectionTable\validateColor
static validateColor()
Definition
sectiontable.php:290
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\Fields\BooleanField
Definition
booleanfield.php:20
Bitrix\Main\ORM\Fields\DatetimeField
Definition
datetimefield.php:22
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\ORM\Fields\TextField
Definition
textfield.php:20
Bitrix\Main\ORM\Fields\Validators\LengthValidator
Definition
lengthvalidator.php:19
Bitrix\Calendar\Internals
Definition
access.php:3
Bitrix\Main
modules
calendar
lib
internals
sectiontable.php
Создано системой
1.10.0