Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
NullChat.php
1<?php
2
3namespace Bitrix\Im\V2\Chat;
4
13
14class NullChat extends Chat
15{
16 private $preparedParams = [];
17
18 protected function getDefaultType(): string
19 {
20 return '';
21 }
22
23 public function setPreparedParams(array $params): self
24 {
25 $this->preparedParams = $params;
26
27 return $this;
28 }
29
30 public function getAuthor(): User
31 {
32 return new NullUser();
33 }
34
35 protected function checkAccessWithoutCaching(int $userId): bool
36 {
37 return false;
38 }
39
40 public function getStartId(?int $userId = null): int
41 {
42 return 0;
43 }
44
45 public function isExist(): bool
46 {
47 return false;
48 }
49
54 public function allowMention(): bool
55 {
56 return false;
57 }
58
63 public function hasAccess($user = null): bool
64 {
65 return false;
66 }
67
68 public function readMessages(?MessageCollection $messages, bool $byEvent = false): Result
69 {
70 return new Result();
71 }
72
73 public function getSelfRelation(array $options = []): ?Relation
74 {
75 return null;
76 }
77
78 public function createChatIfNotExists(array $params): self
79 {
80 $params = array_merge($this->preparedParams, $params);
81
82 $addResult = ChatFactory::getInstance()->addChat($params);
83 if (!$addResult->isSuccess() || !$addResult->hasResult())
84 {
85 return $this;
86 }
87
88 return $addResult->getResult()['CHAT'];
89 }
90
95 public function sendMessage($message, $sendingConfig = null): Result
96 {
98 }
99
104 public function validateMessage(Message $message, SendingConfig $sendingServiceConfig): Result
105 {
107 }
108
113 public function save(): Result
114 {
116 }
117
122 public function updateMessage(Message $message): Result
123 {
125 }
126
131 public function deleteMessage(Message $message): Result
132 {
134 }
135
136 protected function addIndex(): Chat
137 {
138 return $this;
139 }
140
141 protected function updateIndex(): Chat
142 {
143 return $this;
144 }
145}
updateMessage(Message $message)
Definition NullChat.php:122
sendMessage($message, $sendingConfig=null)
Definition NullChat.php:95
validateMessage(Message $message, SendingConfig $sendingServiceConfig)
Definition NullChat.php:104
readMessages(?MessageCollection $messages, bool $byEvent=false)
Definition NullChat.php:68
getStartId(?int $userId=null)
Definition NullChat.php:40
deleteMessage(Message $message)
Definition NullChat.php:131
setPreparedParams(array $params)
Definition NullChat.php:23
getSelfRelation(array $options=[])
Definition NullChat.php:73
checkAccessWithoutCaching(int $userId)
Definition NullChat.php:35
createChatIfNotExists(array $params)
Definition NullChat.php:78
addError(Error $error)
Definition result.php:50