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