1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
NullChat.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Chat;
4
5use Bitrix\Im\V2\Chat;
6use Bitrix\Im\V2\Entity\User\NullUser;
7use Bitrix\Im\V2\Entity\User\User;
8use Bitrix\Im\V2\Message;
9use Bitrix\Im\V2\Message\Send\PushService;
10use Bitrix\Im\V2\Message\Send\SendingConfig;
11use Bitrix\Im\V2\Message\Send\SendResult;
12use Bitrix\Im\V2\MessageCollection;
13use Bitrix\Im\V2\Permission\Action;
14use Bitrix\Im\V2\Relation;
15use Bitrix\Im\V2\RelationCollection;
16use Bitrix\Im\V2\Result;
17
18class NullChat extends Chat
19{
20 protected function getDefaultType(): string
21 {
22 return '';
23 }
24
25 public function getAuthor(): User
26 {
27 return new NullUser();
28 }
29
30 protected function checkAccessInternal(int $userId): Result
31 {
32 return (new Result())->addError(new ChatError(ChatError::ACCESS_DENIED));
33 }
34
35 public function getStartId(?int $userId = null): int
36 {
37 return 0;
38 }
39
40 public function isExist(): bool
41 {
42 return false;
43 }
44
49 public function allowMention(): bool
50 {
51 return false;
52 }
53
55 {
56 return new RelationCollection();
57 }
58
59 public function fillActual(array $fieldsToFill): self
60 {
61 return $this;
62 }
63
64 public function readMessages(?MessageCollection $messages, bool $byEvent = false): Result
65 {
66 return new Result();
67 }
68
69 public function getSelfRelation(): ?Relation
70 {
71 return null;
72 }
73
78 public function sendMessage($message, $sendingConfig = null): SendResult
79 {
80 return (new SendResult())->addError(new ChatError(ChatError::WRONG_TARGET_CHAT));
81 }
82
87 public function validateMessage(Message $message, SendingConfig $sendingServiceConfig): Result
88 {
89 return (new Result)->addError(new ChatError(ChatError::WRONG_TARGET_CHAT));
90 }
91
96 public function save(): Result
97 {
98 return (new Result)->addError(new ChatError(ChatError::CREATION_ERROR));
99 }
100
106 {
107 return (new Result)->addError(new ChatError(ChatError::CREATION_ERROR));
108 }
109
115 {
116 return (new Result)->addError(new ChatError(ChatError::CREATION_ERROR));
117 }
118
119 protected function addIndex(): Chat
120 {
121 return $this;
122 }
123
124 protected function updateIndex(): Chat
125 {
126 return $this;
127 }
128
133
134 public function canDo(Action $action, mixed $target = null): bool
135 {
136 return false;
137 }
138
139 public function getUserCount(): int
140 {
141 return 0;
142 }
143
144 public function getPrevMessageId(): int
145 {
146 return 0;
147 }
148}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
const CREATION_ERROR
Определения ChatError.php:23
const ACCESS_DENIED
Определения ChatError.php:19
const WRONG_TARGET_CHAT
Определения ChatError.php:15
getRelations()
Определения NullChat.php:54
checkAccessInternal(int $userId)
Определения NullChat.php:30
getSelfRelation()
Определения NullChat.php:69
updateMessage(Message $message)
Определения NullChat.php:105
getDefaultType()
Определения NullChat.php:20
getAuthor()
Определения NullChat.php:25
getPushService(Message $message, SendingConfig $config)
Определения NullChat.php:129
sendMessage($message, $sendingConfig=null)
Определения NullChat.php:78
getUserCount()
Определения NullChat.php:139
validateMessage(Message $message, SendingConfig $sendingServiceConfig)
Определения NullChat.php:87
fillActual(array $fieldsToFill)
Определения NullChat.php:59
readMessages(?MessageCollection $messages, bool $byEvent=false)
Определения NullChat.php:64
allowMention()
Определения NullChat.php:49
updateIndex()
Определения NullChat.php:124
getStartId(?int $userId=null)
Определения NullChat.php:35
deleteMessage(Message $message)
Определения NullChat.php:114
getPrevMessageId()
Определения NullChat.php:144
canDo(Action $action, mixed $target=null)
Определения NullChat.php:134
Определения result.php:20
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения Uuid.php:3
$message
Определения payment.php:8
$config
Определения quickway.php:69
$messages
Определения template.php:8
$action
Определения file_dialog.php:21