1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
event.php
См. документацию.
1<?php
2
4
16use Bitrix\Calendar\Core\eventoption\EventOption;
21
23{
24 private const MIN_MEETING_PARTICIPANT = 2;
25
29 protected ?int $id = null;
33 protected ?string $name = null;
41 protected ?Location $location = null;
45 protected ?Date $start = null;
49 protected ?Date $end = null;
53 protected bool $isFullDay = true;
65 protected ?string $description = null;
69 protected ?string $color = null;
73 protected ?string $transparent = null;
77 protected ?Section $section = null;
81 protected ?string $importance = null;
85 protected ?string $accessibility = 'busy';
89 protected bool $isPrivate = false;
93 protected ?Role $eventHost = null;
97 protected ?Role $creator = null;
101 protected ?Role $owner = null;
109 protected ?int $version = 0;
114 protected ?string $eventType = null;
119 protected ?string $calType = null;
123 protected ?string $uid = null;
127 protected bool $isActive = true;
131 protected bool $isDeleted = false;
135 protected ?int $recurrenceId = null;
139 protected ?Date $originalDateFrom = null;
143 protected ?Date $dateCreate = null;
147 protected ?Date $dateModified = null;
155 protected ?DateTimeZone $startTimeZone = null;
159 protected ?DateTimeZone $endTimeZone = null;
163 private ?int $parentId = null;
167 private bool $isMeeting = false;
171 private ?int $dtLength = 0;
175 private ?string $meetingStatus = null;
179 private ?Relations $relations = null;
180
181 private ?EventOption $eventOption = null;
182
183 private ?int $collabId = null;
184
189 public static function fromBuilder(Builder $builder): Event
190 {
191 return $builder->build();
192 }
193
197 public function __toString()
198 {
199 return $this->name ?? '';
200 }
201
206 public function setName(?string $name): Event
207 {
208 $this->name = $name ? Emoji::decode($name) : $name;
209
210 return $this;
211 }
212
218 {
219 $this->recurringRule = $recurringRule;
220
221 return $this;
222 }
223
229 {
230 $this->location = $location;
231
232 return $this;
233 }
234
240 public function setStart(?Date $start): Event
241 {
242 $this->start = $start;
243
244 return $this;
245 }
246
252 public function setStartTimeZone(?DateTimeZone $timezone): Event
253 {
254 $this->startTimeZone = $timezone;
255
256 return $this;
257 }
258
264 public function setEndTimeZone(?DateTimeZone $timezone): Event
265 {
266 $this->endTimeZone = $timezone;
267 return $this;
268 }
269
275 public function setEnd(?Date $end): Event
276 {
277 $this->end = $end;
278
279 return $this;
280 }
281
286 public function setAttendeesCollection(?AttendeeCollection $collection): Event
287 {
288 $this->attendeeCollection = $collection;
289
290 return $this;
291 }
292
297 public function setIsFullDay(bool $isFullDay): Event
298 {
299 $this->isFullDay = $isFullDay;
300
301 return $this;
302 }
303
309 public function setRemindCollection(?Properties\RemindCollection $remindCollection): Event
310 {
311 $this->remindCollection = $remindCollection;
312
313 return $this;
314 }
315
320 public function setSection(?Section $section): Event
321 {
322 $this->section = $section;
323
324 return $this;
325 }
326
331 public function setDescription(?string $description): Event
332 {
333 $this->description = $description ? Emoji::decode($description) : $description;
334
335 return $this;
336 }
337
342 public function setColor(?string $color): Event
343 {
344 $this->color = $color;
345
346 return $this;
347 }
348
353 public function setAccessibility(?string $accessibility): Event
354 {
355 $this->accessibility = $accessibility;
356
357 return $this;
358 }
359
364 public function setImportance(?string $importance): Event
365 {
366 $this->importance = $importance;
367
368 return $this;
369 }
370
375 public function setIsPrivate(bool $isPrivate): Event
376 {
377 $this->isPrivate = $isPrivate;
378
379 return $this;
380 }
381
387 {
388 $this->eventHost = $eventHost;
389
390 return $this;
391 }
392
397 public function setCreator(?Role $creator): Event
398 {
399 $this->creator = $creator;
400
401 return $this;
402 }
403
408 public function setOwner(?Role $owner): Event
409 {
410 $this->owner = $owner;
411
412 return $this;
413 }
414
419 public function setVersion(int $version): Event
420 {
421 $this->version = $version;
422
423 return $this;
424 }
425
431 {
432 $this->originalDateFrom = $originalDateFrom;
433
434 return $this;
435 }
436
441 public function setRecurrenceId(?int $recurrenceId): Event
442 {
443 $this->recurrenceId = $recurrenceId;
444
445 return $this;
446 }
447
453 {
454 $this->dateCreate = $dateCreate;
455
456 return $this;
457 }
458
464 {
465 $this->dateModified = $dateModified;
466
467 return $this;
468 }
469
474 public function setIsActive(bool $isActive): Event
475 {
476 $this->isActive = $isActive;
477
478 return $this;
479 }
480
485 public function setIsDeleted(bool $isDeleted): Event
486 {
487 $this->isDeleted = $isDeleted;
488
489 return $this;
490 }
491
496 public function setUid(?string $uid): Event
497 {
498 $this->uid = $uid;
499
500 return $this;
501 }
502
507 public function setTransparent(?string $transparent): Event
508 {
509 $this->transparent = $transparent;
510
511 return $this;
512 }
513
519 {
520 $this->excludedDateCollection = $excludedDateCollection;
521
522 return $this;
523 }
524
532 public function setEventType(?string $eventType): Event
533 {
534 $this->eventType = $eventType;
535
536 return $this;
537 }
538
544 public function setSpecialLabel(?string $label): Event
545 {
546 $this->eventType = $label;
547
548 return $this;
549 }
550
557 {
558 $this->meetingDescription = $meetingDescription;
559
560 return $this;
561 }
562
568 public function setRelations(?Relations $relations): Event
569 {
570 $this->relations = $relations;
571
572 return $this;
573 }
574
575
579 public function getName(): ?string
580 {
581 return $this->name;
582 }
583
588 {
590 }
591
595 public function getLocation(): ?Location
596 {
597 return $this->location;
598 }
599
603 public function getStart(): Date
604 {
605 return $this->start;
606 }
607
611 public function getStartTimeZone(): ?DateTimeZone
612 {
614 }
615
619 public function getEndTimeZone(): ?DateTimeZone
620 {
621 return $this->endTimeZone;
622 }
623
627 public function getEnd(): Date
628 {
629 return $this->end;
630 }
631
636 {
637 if (is_null($this->attendeeCollection))
638 {
639 $this->initAttendeesCollection();
640 }
642 }
643
647 public function getDescription(): ?string
648 {
649 return $this->description;
650 }
651
655 public function getOwner(): ?Role
656 {
657 return $this->owner;
658 }
659
663 public function getCreator(): ?Role
664 {
665 return $this->creator;
666 }
667
671 public function getEventHost(): ?Role
672 {
673 return $this->eventHost;
674 }
675
679 public function getIsPrivate(): bool
680 {
681 return $this->isPrivate;
682 }
683
687 public function isPrivate(): bool
688 {
689 return $this->isPrivate;
690 }
691
695 public function getAccessibility(): ?string
696 {
698 }
699
703 public function getImportance(): ?string
704 {
705 return $this->importance;
706 }
707
711 public function getSection(): Section
712 {
713 if ($this->section === null)
714 {
715 $this->initSection();
716 }
717
718 return $this->section;
719 }
720
724 public function getColor(): ?string
725 {
726 return $this->color;
727 }
728
732 public function getTransparent(): ?string
733 {
734 return $this->transparent;
735 }
736
741 {
743 }
744
748 public function getRelations(): ?Relations
749 {
750 return $this->relations;
751 }
752
756 public function getVersion(): int
757 {
758 return $this->version;
759 }
760
766 public function getEventType(): ?string
767 {
768 return $this->eventType;
769 }
770
774 public function getSpecialLabel(): ?string
775 {
776 return $this->eventType;
777 }
778
782 public function getUid(): ?string
783 {
784 return $this->uid;
785 }
786
790 public function isActive(): bool
791 {
792 return $this->isActive;
793 }
794
798 public function isDeleted(): bool
799 {
800 return $this->isDeleted;
801 }
802
806 public function isInstance(): bool
807 {
808 return $this->recurrenceId && $this->originalDateFrom;
809 }
810
814 public function getRecurrenceId(): ?int
815 {
816 return $this->recurrenceId;
817 }
818
822 public function getOriginalDateFrom(): ?Date
823 {
825 }
826
830 public function getDateCreate(): ?Date
831 {
832 return $this->dateCreate;
833 }
834
838 public function getDateModified(): ?Date
839 {
840 return $this->dateModified;
841 }
842
850
854 public function isFullDayEvent(): bool
855 {
856 return $this->isFullDay;
857 }
858
862 public function isRecurrence(): bool
863 {
864 return $this->recurringRule && $this->recurringRule->getFrequency();
865 }
866
870 public function isSingle(): bool
871 {
872 return !$this->isInstance() && !$this->isRecurrence();
873 }
874
878 public function isBaseEvent(): bool
879 {
880 return ($this->id === $this->parentId) && ($this->id !== null);
881 }
882
886 public function getRemindCollection(): ?Properties\RemindCollection
887 {
889 }
890
894 public function isMeeting(): bool
895 {
896 if ($this->isMeeting === false)
897 {
898 return $this->attendeeCollection
899 && count($this->attendeeCollection) >= self::MIN_MEETING_PARTICIPANT;
900 }
901
902 return true;
903 }
904
908 public function getId(): ?int
909 {
910 return $this->id;
911 }
912
917 public function setId(?int $id): Event
918 {
919 $this->id = $id;
920
921 return $this;
922 }
923
924 private function initAttendeesCollection(): void
925 {
926 // TODO: need to implement a logic
927 $this->attendeeCollection = new AttendeeCollection();
928 }
929
930 private function initSection(): void
931 {
932 // TODO: need to implement a logic
933 $this->section = new Section();
934 }
935
940 public function setParentId(?int $parentId): Event
941 {
942 $this->parentId = $parentId;
943
944 return $this;
945 }
946
950 public function getParentId(): ?int
951 {
952 return $this->parentId;
953 }
954
959 public function setIsMeeting(bool $isMeeting): Event
960 {
961 $this->isMeeting = $isMeeting;
962
963 return $this;
964 }
965
970 public function setMeetingStatus(?string $meetingStatus): Event
971 {
972 $this->meetingStatus = $meetingStatus;
973
974 return $this;
975 }
976
980 public function getMeetingStatus(): ?string
981 {
982 return $this->meetingStatus;
983 }
984
988 public function isNew(): bool
989 {
990 return $this->id === 0 || $this->id === null;
991 }
992
996 public function upVersion(): self
997 {
998 $this->version++;
999
1000 return $this;
1001 }
1002
1006 public function getCalendarType(): ?string
1007 {
1008 return $this->calType;
1009 }
1010
1016 public function setCalendarType(?string $calendarType): self
1017 {
1018 $this->calType = $calendarType;
1019 return $this;
1020 }
1021
1022 public function getEventOption(): ?EventOption
1023 {
1024 return $this->eventOption;
1025 }
1026
1027 public function setEventOption(?EventOption $eventOption): self
1028 {
1029 $this->eventOption = $eventOption;
1030
1031 return $this;
1032 }
1033
1034 public function isOpenEvent(): bool
1035 {
1036 return $this->getSection()?->getType() === Dictionary::CALENDAR_TYPE['open_event'];
1037 }
1038
1039 public function setDtLength(?int $dtLength): self
1040 {
1041 $this->dtLength = $dtLength;
1042
1043 return $this;
1044 }
1045
1046 public function getDtLength(): ?int
1047 {
1048 return $this->dtLength;
1049 }
1050
1051 public function setCollabId(?int $collabId): self
1052 {
1053 $this->collabId = $collabId;
1054
1055 return $this;
1056 }
1057
1058 public function getCollabId(): ?int
1059 {
1060 return $this->collabId;
1061 }
1062
1063 public function toArray(): array
1064 {
1065 return [
1066 'ID' => $this->id,
1067 'PARENT_ID' => $this->parentId,
1068 'ACTIVE' => $this->isActive ? 'Y' : 'N',
1069 'DELETED' => $this->isDeleted ? 'Y' : 'N',
1070 'CAL_TYPE' => $this->calType,
1071 'OWNER' => $this->owner?->getId(),
1072 'NAME' => $this->name,
1073 'DATE_FROM' => $this->start,
1074 'DATE_TO' => $this->end,
1075 'TZ_FROM' => $this->startTimeZone,
1076 'TZ_TO' => $this->endTimeZone,
1077 'DT_SKIP_TIME' => $this->isFullDay ? 'Y' : 'N',
1078 'DT_LENGTH' => $this->dtLength,
1079 'EVENT_TYPE' => $this->eventType,
1080 'CREATED_BY' => $this->creator?->getId(),
1081 'DATE_CREATE' => $this->dateCreate,
1082 'DESCRIPTION' => $this->description,
1083 'ACCESSIBILITY' => $this->accessibility,
1084 'IMPORTANCE' => $this->importance,
1085 'IS_MEETING' => $this->isMeeting,
1086 'MEETING_STATUS' => $this->meetingStatus,
1087 'MEETING_HOST' => $this->eventHost?->getId(),
1088 'MEETING' => $this->getMeetingDescription(),
1089 'LOCATION' => $this->location?->toString(),
1090 'REMIND' => $this->remindCollection->getCollection(),
1091 'COLOR' => $this->color,
1092 'RRULE' => $this->recurringRule->toArray(),
1093 'VERSION' => $this->version,
1094 'ATTENDEES_CODE' => implode(',', $this->attendeeCollection->getAttendeesCodes()),
1095 'SECTION_ID' => $this->section?->getId(),
1096 ];
1097 }
1098}
xml version
Определения yandex.php:67
DateTimeZone $startTimeZone
Определения event.php:155
setId(?int $id)
Определения event.php:917
getExcludedDateCollection()
Определения event.php:846
DateTimeZone $endTimeZone
Определения event.php:159
setCollabId(?int $collabId)
Определения event.php:1051
getRemindCollection()
Определения event.php:886
Role $creator
Определения event.php:97
setMeetingDescription(?MeetingDescription $meetingDescription)
Определения event.php:556
Date $originalDateFrom
Определения event.php:139
Role $eventHost
Определения event.php:93
bool $isPrivate
Определения event.php:89
string $description
Определения event.php:65
setRemindCollection(?Properties\RemindCollection $remindCollection)
Определения event.php:309
setParentId(?int $parentId)
Определения event.php:940
setIsMeeting(bool $isMeeting)
Определения event.php:959
setSection(?Section $section)
Определения event.php:320
setIsPrivate(bool $isPrivate)
Определения event.php:375
string $importance
Определения event.php:81
string $transparent
Определения event.php:73
setStartTimeZone(?DateTimeZone $timezone)
Определения event.php:252
Section $section
Определения event.php:77
setRelations(?Relations $relations)
Определения event.php:568
bool $isActive
Определения event.php:127
setStart(?Date $start)
Определения event.php:240
MeetingDescription $meetingDescription
Определения event.php:105
setAccessibility(?string $accessibility)
Определения event.php:353
setIsFullDay(bool $isFullDay)
Определения event.php:297
string $name
Определения event.php:33
getOriginalDateFrom()
Определения event.php:822
setEventType(?string $eventType)
Определения event.php:532
setSpecialLabel(?string $label)
Определения event.php:544
bool $isFullDay
Определения event.php:53
Properties RemindCollection $remindCollection
Определения event.php:61
bool $isDeleted
Определения event.php:131
RecurringEventRules $recurringRule
Определения event.php:37
Date $dateCreate
Определения event.php:143
string $accessibility
Определения event.php:85
string $calType
Определения event.php:119
Date $dateModified
Определения event.php:147
setAttendeesCollection(?AttendeeCollection $collection)
Определения event.php:286
getMeetingDescription()
Определения event.php:740
setRecurrenceId(?int $recurrenceId)
Определения event.php:441
static fromBuilder(Builder $builder)
Определения event.php:189
setRecurringRule(?RecurringEventRules $recurringRule)
Определения event.php:217
setName(?string $name)
Определения event.php:206
setEndTimeZone(?DateTimeZone $timezone)
Определения event.php:264
setMeetingStatus(?string $meetingStatus)
Определения event.php:970
setTransparent(?string $transparent)
Определения event.php:507
string $color
Определения event.php:69
ExcludedDatesCollection $excludedDateCollection
Определения event.php:151
setImportance(?string $importance)
Определения event.php:364
setIsActive(bool $isActive)
Определения event.php:474
string $uid
Определения event.php:123
setLocation(?Location $location)
Определения event.php:228
setCalendarType(?string $calendarType)
Определения event.php:1016
setEventOption(?EventOption $eventOption)
Определения event.php:1027
AttendeeCollection $attendeeCollection
Определения event.php:57
setDateCreate(?Date $dateCreate)
Определения event.php:452
setEnd(?Date $end)
Определения event.php:275
setExcludedDateCollection(?ExcludedDatesCollection $excludedDateCollection)
Определения event.php:518
setOriginalDateFrom(?Date $originalDateFrom)
Определения event.php:430
setEventHost(?Role $eventHost)
Определения event.php:386
setUid(?string $uid)
Определения event.php:496
setDescription(?string $description)
Определения event.php:331
string $eventType
Определения event.php:114
Date $start
Определения event.php:45
setVersion(int $version)
Определения event.php:419
setColor(?string $color)
Определения event.php:342
setCreator(?Role $creator)
Определения event.php:397
setDateModified(?Date $dateModified)
Определения event.php:463
int $recurrenceId
Определения event.php:135
Location $location
Определения event.php:41
setDtLength(?int $dtLength)
Определения event.php:1039
setIsDeleted(bool $isDeleted)
Определения event.php:485
getAttendeesCollection()
Определения event.php:635
setOwner(?Role $owner)
Определения event.php:408
Определения emoji.php:10
Определения date.php:9
toString(Context\Culture $culture=null)
Определения date.php:241
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
background color
Определения file_new.php:745
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936