1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
BaseLinkCollection.php
См. документацию.
1<?php
2
4
13
19{
23 abstract public static function getCollectionElementClass(): string;
24
25 public function getPopupData(array $excludedList = []): PopupData
26 {
27 $data = new PopupData([new Entity\User\UserPopupItem()], $excludedList);
28
29 foreach ($this as $link)
30 {
31 $data->mergeFromEntity($link, $excludedList);
32 }
33
34 return $data;
35 }
36
37 public function filterByDate(DateTime $date): FilterResult
38 {
39 $filtered = $this->filter(static fn (BaseLinkItem $link) => $link->getDateCreate()?->getTimestamp() > $date->getTimestamp());
40
41 return (new FilterResult())->setResult($filtered)->setFiltered($this->count() !== $filtered->count());
42 }
43
44 public function getRelatedChatId(): ?int
45 {
46 return $this->getAny()?->getChatId();
47 }
48
49 public static function getRestEntityName(): string
50 {
51 return 'list';
52 }
53
54 public function toRestFormatIdOnly(): array
55 {
56 $ids = [];
57
58 foreach ($this as $item)
59 {
60 $ids[] = $item->toRestFormatIdOnly();
61 }
62
63 return $ids;
64 }
65
67 {
68 foreach ($this as $link)
69 {
70 $link->setMessageInfo($message);
71 }
72
73 return $this;
74 }
75
76 public function getEntityIds(): array
77 {
78 $ids = [];
79
80 foreach ($this as $link)
81 {
82 $ids[] = $link->getEntityId();
83 }
84
85 return $ids;
86 }
87
94 public static function linkEntityToMessage(Entity\EntityCollection $entities, Message $message): self
95 {
96 $linkCollection = new static();
97
98 foreach ($entities as $entity)
99 {
100 $linkItemClass = static::getCollectionElementClass();
102 $linkItem = new $linkItemClass;
103 $linkItem->setEntity($entity)->setMessageInfo($message);
104 $linkCollection->add($linkItem);
105 }
106
107 return $linkCollection;
108 }
109
110 public function toRestFormat(array $option = []): array
111 {
112 $linkCollection = [];
113
114 foreach ($this as $link)
115 {
116 $linkCollection[] = $link->toRestFormat($option);
117 }
118
119 return $linkCollection;
120 }
121}
getTimestamp()
Определения date.php:218
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$entity
Определения Uuid.php:3
Определения ufield.php:9
$message
Определения payment.php:8
$option
Определения options.php:1711