Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
eventtable.php
1
<?php
2
3
namespace
Bitrix\Calendar\Internals
;
4
5
use
Bitrix\Calendar\Util
;
6
use
Bitrix\Main
;
7
use Bitrix\Main\Entity\ReferenceField;
8
use
Bitrix\Main\Localization\Loc
;
9
use Bitrix\Main\ORM\Data\Internal\DeleteByFilterTrait;
10
use
Bitrix\Main\ORM\Query\Join
;
11
use
Bitrix\Main\ORM\Fields\BooleanField
;
12
use
Bitrix\Main\ORM\Fields\DatetimeField
;
13
use
Bitrix\Main\ORM\Fields\IntegerField
;
14
use
Bitrix\Main\ORM\Fields\StringField
;
15
use
Bitrix\Main\ORM\Fields\TextField
;
16
use
Bitrix\Main\ORM\Fields\Validators\LengthValidator
;
17
34
class
EventTable
extends
Main\Entity\DataManager
35
{
36
use DeleteByFilterTrait;
37
43
public
static
function
getTableName
()
44
{
45
return
'b_calendar_event'
;
46
}
47
53
public
static
function
getUfId
()
54
{
55
return
Util::USER_FIELD_ENTITY_ID
;
56
}
57
58
65
public
static
function
getMap
()
66
{
67
return
[
68
(
new
IntegerField
(
'ID'
))
69
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_ID_FIELD'
))
70
->configurePrimary(
true
)
71
->configureAutocomplete(
true
)
72
,
73
(
new
IntegerField
(
'PARENT_ID'
))
74
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_PARENT_ID_FIELD'
))
75
,
76
(
new
BooleanField
(
'ACTIVE'
))
77
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_ACTIVE_FIELD'
))
78
->configureValues(
'N'
,
'Y'
)
79
->configureDefaultValue(
'Y'
)
80
,
81
(
new
BooleanField
(
'DELETED'
))
82
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DELETED_FIELD'
))
83
->configureValues(
'N'
,
'Y'
)
84
->configureDefaultValue(
'N'
)
85
,
86
(
new
StringField
(
'CAL_TYPE'
,
87
[
88
'validation'
=> [__CLASS__,
'validateCalType'
]
89
]
90
))
91
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_CAL_TYPE_FIELD'
))
92
,
93
(
new
IntegerField
(
'OWNER_ID'
))
94
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_OWNER_ID_FIELD'
))
95
->configureRequired(
true
)
96
,
97
(
new
StringField
(
'NAME'
,
98
[
99
'validation'
=> [__CLASS__,
'validateName'
]
100
]
101
))
102
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_NAME_FIELD'
))
103
,
104
(
new
DatetimeField
(
'DATE_FROM'
))
105
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DATE_FROM_FIELD'
))
106
,
107
(
new
DatetimeField
(
'DATE_TO'
))
108
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DATE_TO_FIELD'
))
109
,
110
(
new
DatetimeField
(
'ORIGINAL_DATE_FROM'
))
111
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_ORIGINAL_DATE_FROM_FIELD'
))
112
,
113
(
new
StringField
(
'TZ_FROM'
,
114
[
115
'validation'
=> [__CLASS__,
'validateTzFrom'
]
116
]
117
))
118
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_TZ_FROM_FIELD'
))
119
,
120
(
new
StringField
(
'TZ_TO'
,
121
[
122
'validation'
=> [__CLASS__,
'validateTzTo'
]
123
]
124
))
125
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_TZ_TO_FIELD'
))
126
,
127
(
new
IntegerField
(
'TZ_OFFSET_FROM'
))
128
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_TZ_OFFSET_FROM_FIELD'
))
129
,
130
(
new
IntegerField
(
'TZ_OFFSET_TO'
))
131
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_TZ_OFFSET_TO_FIELD'
))
132
,
133
(
new
IntegerField
(
'DATE_FROM_TS_UTC'
))
134
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DATE_FROM_TS_UTC_FIELD'
))
135
,
136
(
new
IntegerField
(
'DATE_TO_TS_UTC'
))
137
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DATE_TO_TS_UTC_FIELD'
))
138
,
139
(
new
BooleanField
(
'DT_SKIP_TIME'
))
140
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DT_SKIP_TIME_FIELD'
))
141
->configureValues(
'N'
,
'Y'
)
142
->configureDefaultValue(
'N'
)
143
,
144
(
new
IntegerField
(
'DT_LENGTH'
))
145
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DT_LENGTH_FIELD'
))
146
,
147
(
new
StringField
(
'EVENT_TYPE'
,
148
[
149
'validation'
=> [__CLASS__,
'validateEventType'
]
150
]
151
))
152
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_EVENT_TYPE_FIELD'
))
153
,
154
(
new
IntegerField
(
'CREATED_BY'
))
155
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_CREATED_BY_FIELD'
))
156
->configureRequired(
true
)
157
,
158
(
new
DatetimeField
(
'DATE_CREATE'
))
159
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DATE_CREATE_FIELD'
))
160
,
161
(
new
DatetimeField
(
'TIMESTAMP_X'
))
162
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_TIMESTAMP_X_FIELD'
))
163
,
164
(
new
TextField
(
'DESCRIPTION'
))
165
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DESCRIPTION_FIELD'
))
166
,
167
(
new
DatetimeField
(
'DT_FROM'
))
168
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DT_FROM_FIELD'
))
169
,
170
(
new
DatetimeField
(
'DT_TO'
))
171
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DT_TO_FIELD'
))
172
,
173
(
new
StringField
(
'PRIVATE_EVENT'
,
174
[
175
'validation'
=> [__CLASS__,
'validatePrivateEvent'
]
176
]
177
))
178
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_PRIVATE_EVENT_FIELD'
))
179
,
180
(
new
StringField
(
'ACCESSIBILITY'
,
181
[
182
'validation'
=> [__CLASS__,
'validateAccessibility'
]
183
]
184
))
185
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_ACCESSIBILITY_FIELD'
))
186
,
187
(
new
StringField
(
'IMPORTANCE'
,
188
[
189
'validation'
=> [__CLASS__,
'validateImportance'
]
190
]
191
))->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_IMPORTANCE_FIELD'
))
192
,
193
(
new
StringField
(
'IS_MEETING'
,
194
[
195
'validation'
=> [__CLASS__,
'validateIsMeeting'
]
196
]
197
))
198
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_IS_MEETING_FIELD'
))
199
,
200
(
new
StringField
(
'MEETING_STATUS'
,
201
[
202
'validation'
=> [__CLASS__,
'validateMeetingStatus'
]
203
]
204
))
205
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_MEETING_STATUS_FIELD'
))
206
,
207
(
new
IntegerField
(
'MEETING_HOST'
))
208
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_MEETING_HOST_FIELD'
))
209
,
210
(
new
TextField
(
'MEETING'
))
211
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_MEETING_FIELD'
))
212
,
213
(
new
StringField
(
'LOCATION'
,
214
[
215
'validation'
=> [__CLASS__,
'validateLocation'
]
216
]
217
))
218
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_LOCATION_FIELD'
))
219
,
220
(
new
TextField
(
'REMIND'
,
221
[
222
'validation'
=> [__CLASS__,
'validateRemind'
]
223
]
224
))
225
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_REMIND_FIELD'
))
226
,
227
(
new
StringField
(
'COLOR'
,
228
[
229
'validation'
=> [__CLASS__,
'validateColor'
]
230
]
231
))
232
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_COLOR_FIELD'
))
233
,
234
(
new
StringField
(
'TEXT_COLOR'
,
235
[
236
'validation'
=> [__CLASS__,
'validateTextColor'
]
237
]
238
))
239
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_TEXT_COLOR_FIELD'
))
240
,
241
(
new
StringField
(
'RRULE'
,
242
[
243
'validation'
=> [__CLASS__,
'validateRrule'
]
244
]
245
))
246
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_RRULE_FIELD'
))
247
,
248
(
new
TextField
(
'EXDATE'
,
249
[]
250
))
251
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_EXDATE_FIELD'
))
252
,
253
(
new
StringField
(
'DAV_XML_ID'
,
254
[
255
'validation'
=> [__CLASS__,
'validateDavXmlId'
]
256
]
257
))
258
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DAV_XML_ID_FIELD'
))
259
,
260
(
new
StringField
(
'G_EVENT_ID'
,
261
[
262
'validation'
=> [__CLASS__,
'validateGEventId'
]
263
]
264
))
265
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_G_EVENT_ID_FIELD'
))
266
,
267
(
new
StringField
(
'DAV_EXCH_LABEL'
,
268
[
269
'validation'
=> [__CLASS__,
'validateDavExchLabel'
]
270
]
271
))
272
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_DAV_EXCH_LABEL_FIELD'
))
273
,
274
(
new
StringField
(
'CAL_DAV_LABEL'
,
275
[
276
'validation'
=> [__CLASS__,
'validateCalDavLabel'
]
277
]
278
))
279
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_CAL_DAV_LABEL_FIELD'
))
280
,
281
(
new
StringField
(
'VERSION'
,
282
[
283
'validation'
=> [__CLASS__,
'validateVersion'
]
284
]
285
))
286
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_VERSION_FIELD'
))
287
,
288
(
new
TextField
(
'ATTENDEES_CODES'
))
289
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_ATTENDEES_CODES_FIELD'
))
290
,
291
(
new
IntegerField
(
'RECURRENCE_ID'
))
292
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_RECURRENCE_ID_FIELD'
))
293
,
294
(
new
StringField
(
'RELATIONS'
,
295
[
296
'validation'
=> [__CLASS__,
'validateRelations'
]
297
]
298
))
299
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_RELATIONS_FIELD'
))
300
,
301
(
new
TextField
(
'SEARCHABLE_CONTENT'
))
302
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_SEARCHABLE_CONTENT_FIELD'
))
303
,
304
(
new
IntegerField
(
'SECTION_ID'
))
305
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_SECTION_ID_FIELD'
))
306
,
307
(
new
StringField
(
'SYNC_STATUS'
,
308
[
309
'validation'
=> [__CLASS__,
'validateSyncStatus'
]
310
]
311
))
312
->configureTitle(
Loc::getMessage
(
'EVENT_ENTITY_SYNC_STATUS_FIELD'
))
313
,
314
(
new
ReferenceField(
315
'SECTION'
,
316
SectionTable::class,
317
Join::on(
'this.SECTION_ID'
,
'ref.ID'
),
318
))
319
,
320
(
new
ReferenceField(
321
'EVENT_SECT'
,
322
EventSectTable::class,
323
Join::on(
'this.ID'
,
'ref.EVENT_ID'
),
324
))
325
,
326
];
327
}
328
334
public
static
function
validateCalType
(): array
335
{
336
return
[
337
new
LengthValidator
(
null
, 100),
338
];
339
}
340
346
public
static
function
validateName
(): array
347
{
348
return
[
349
new
LengthValidator
(
null
, 255),
350
];
351
}
352
358
public
static
function
validateTzFrom
(): array
359
{
360
return
[
361
new
LengthValidator
(
null
, 50),
362
];
363
}
364
370
public
static
function
validateTzTo
(): array
371
{
372
return
[
373
new
LengthValidator
(
null
, 50),
374
];
375
}
376
382
public
static
function
validateEventType
(): array
383
{
384
return
[
385
new
LengthValidator
(
null
, 50),
386
];
387
}
388
394
public
static
function
validatePrivateEvent
(): array
395
{
396
return
[
397
new
LengthValidator
(
null
, 10),
398
];
399
}
400
406
public
static
function
validateAccessibility
(): array
407
{
408
return
[
409
new
LengthValidator
(
null
, 10),
410
];
411
}
412
418
public
static
function
validateImportance
(): array
419
{
420
return
[
421
new
LengthValidator
(
null
, 10),
422
];
423
}
424
430
public
static
function
validateIsMeeting
(): array
431
{
432
return
[
433
new
LengthValidator
(
null
, 1),
434
];
435
}
436
442
public
static
function
validateMeetingStatus
(): array
443
{
444
return
[
445
new
LengthValidator
(
null
, 1),
446
];
447
}
448
454
public
static
function
validateLocation
(): array
455
{
456
return
[
457
new
LengthValidator
(
null
, 255),
458
];
459
}
460
466
public
static
function
validateColor
(): array
467
{
468
return
[
469
new
LengthValidator
(
null
, 10),
470
];
471
}
472
478
public
static
function
validateTextColor
(): array
479
{
480
return
[
481
new
LengthValidator
(
null
, 10),
482
];
483
}
484
490
public
static
function
validateRrule
(): array
491
{
492
return
[
493
new
LengthValidator
(
null
, 255),
494
];
495
}
496
502
public
static
function
validateDavXmlId
(): array
503
{
504
return
[
505
new
LengthValidator
(
null
, 255),
506
];
507
}
508
514
public
static
function
validateGEventId
(): array
515
{
516
return
[
517
new
LengthValidator
(
null
, 255),
518
];
519
}
520
526
public
static
function
validateDavExchLabel
(): array
527
{
528
return
[
529
new
LengthValidator
(
null
, 255),
530
];
531
}
532
538
public
static
function
validateCalDavLabel
(): array
539
{
540
return
[
541
new
LengthValidator
(
null
, 255),
542
];
543
}
544
550
public
static
function
validateVersion
(): array
551
{
552
return
[
553
new
LengthValidator
(
null
, 255),
554
];
555
}
556
562
public
static
function
validateRelations
(): array
563
{
564
return
[
565
new
LengthValidator
(
null
, 255),
566
];
567
}
568
574
public
static
function
validateSyncStatus
(): array
575
{
576
return
[
577
new
LengthValidator
(
null
, 20),
578
];
579
}
580
586
public
static
function
validateRemind
()
587
{
588
return
array(
589
new
Main\
Entity
\Validator\Length(
null
, 255),
590
);
591
}
592
}
Bitrix\Calendar\Internals\EventTable\validateSyncStatus
static validateSyncStatus()
Definition
eventtable.php:574
Bitrix\Calendar\Internals\EventTable\getMap
static getMap()
Definition
eventtable.php:65
Bitrix\Calendar\Internals\EventTable\validateGEventId
static validateGEventId()
Definition
eventtable.php:514
Bitrix\Calendar\Internals\EventTable\getUfId
static getUfId()
Definition
eventtable.php:53
Bitrix\Calendar\Internals\EventTable\validateCalType
static validateCalType()
Definition
eventtable.php:334
Bitrix\Calendar\Internals\EventTable\validateIsMeeting
static validateIsMeeting()
Definition
eventtable.php:430
Bitrix\Calendar\Internals\EventTable\validateRemind
static validateRemind()
Definition
eventtable.php:586
Bitrix\Calendar\Internals\EventTable\validateMeetingStatus
static validateMeetingStatus()
Definition
eventtable.php:442
Bitrix\Calendar\Internals\EventTable\validateRrule
static validateRrule()
Definition
eventtable.php:490
Bitrix\Calendar\Internals\EventTable\validateLocation
static validateLocation()
Definition
eventtable.php:454
Bitrix\Calendar\Internals\EventTable\validateTzFrom
static validateTzFrom()
Definition
eventtable.php:358
Bitrix\Calendar\Internals\EventTable\validateTzTo
static validateTzTo()
Definition
eventtable.php:370
Bitrix\Calendar\Internals\EventTable\validateAccessibility
static validateAccessibility()
Definition
eventtable.php:406
Bitrix\Calendar\Internals\EventTable\validatePrivateEvent
static validatePrivateEvent()
Definition
eventtable.php:394
Bitrix\Calendar\Internals\EventTable\validateCalDavLabel
static validateCalDavLabel()
Definition
eventtable.php:538
Bitrix\Calendar\Internals\EventTable\validateImportance
static validateImportance()
Definition
eventtable.php:418
Bitrix\Calendar\Internals\EventTable\validateName
static validateName()
Definition
eventtable.php:346
Bitrix\Calendar\Internals\EventTable\validateEventType
static validateEventType()
Definition
eventtable.php:382
Bitrix\Calendar\Internals\EventTable\validateRelations
static validateRelations()
Definition
eventtable.php:562
Bitrix\Calendar\Internals\EventTable\validateDavExchLabel
static validateDavExchLabel()
Definition
eventtable.php:526
Bitrix\Calendar\Internals\EventTable\validateVersion
static validateVersion()
Definition
eventtable.php:550
Bitrix\Calendar\Internals\EventTable\validateTextColor
static validateTextColor()
Definition
eventtable.php:478
Bitrix\Calendar\Internals\EventTable\validateDavXmlId
static validateDavXmlId()
Definition
eventtable.php:502
Bitrix\Calendar\Internals\EventTable\getTableName
static getTableName()
Definition
eventtable.php:43
Bitrix\Calendar\Internals\EventTable\validateColor
static validateColor()
Definition
eventtable.php:466
Bitrix\Calendar\Util
Definition
util.php:16
Bitrix\Calendar\Util\USER_FIELD_ENTITY_ID
const USER_FIELD_ENTITY_ID
Definition
util.php:18
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\Entity
Definition
entity.php:26
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\Main\ORM\Query\Join
Definition
join.php:19
Bitrix\Calendar\Internals
Definition
access.php:3
Bitrix\Main
modules
calendar
lib
internals
eventtable.php
Создано системой
1.10.0