Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ReplayedMessageCollection.php
1<?php
2
4
11
13{
14 public static function createByMessageCollection(MessageCollection $collection): self
15 {
16 $instance = new self();
17
18 $replyIdList = $instance->getReplyIdList($collection);
19 if (!empty($replyIdList))
20 {
21 $instance->load($replyIdList);
22 }
23
24 return $instance;
25 }
26
27 public function getPopupData(array $excludedList = []): PopupData
28 {
29 return new PopupData([
30 new UserPopupItem($this->getUserIds()),
31 new FilePopupItem($this->getFiles()),
33 ], $excludedList);
34 }
35
36 private function getReplyIdList(MessageCollection $messageCollection): array
37 {
38 $messageCollection->fillParams();
39 $result = [];
40 foreach ($messageCollection as $message)
41 {
42 if ($message->getParams()->isSet(Params::REPLY_ID))
43 {
44 $result[] = $message->getParams()->get(Params::REPLY_ID)->getValue();
45 }
46 }
47
48 return $result;
49 }
50
51}
static createByMessageCollection(MessageCollection $collection)