1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
Anchor.php
См. документацию.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
Bitrix\Im\V2\Controller\Chat
;
6
7
use
Bitrix\Im\V2\Anchor\DI\AnchorContainer
;
8
use
Bitrix\Im\V2\Chat
;
9
use
Bitrix\Im\V2\Controller\BaseController
;
10
use
Bitrix\Main\Engine\CurrentUser
;
11
12
final
class
Anchor
extends
BaseController
13
{
14
private
AnchorContainer
$anchorContainer;
15
16
private
int
$userId;
17
21
public
function
readAction
(
Chat
$chat): ?bool
22
{
23
$readService = $this->anchorContainer->getReadService()->withContextUser($this->userId);
24
25
$result
= $readService->readByChatId($chat->getId());
26
if
(!
$result
->isSuccess())
27
{
28
$this->addErrors(
$result
->getErrors());
29
30
return
null
;
31
}
32
33
return
true
;
34
}
35
36
protected
function
init
(): void
37
{
38
parent::init();
39
40
$this->anchorContainer = AnchorContainer::getInstance();
41
$this->userId = (int)CurrentUser::get()->getId();
42
}
43
}
Bitrix\Im\V2\Anchor\DI\AnchorContainer
Определения
AnchorContainer.php:16
Bitrix\Im\V2\Controller\BaseController
Определения
BaseController.php:30
Bitrix\Im\V2\Controller\Chat\Anchor
Определения
Anchor.php:13
Bitrix\Im\V2\Controller\Chat\Anchor\readAction
readAction(Chat $chat)
Определения
Anchor.php:21
Bitrix\Im\V2\Controller\Chat\Anchor\init
init()
Определения
Anchor.php:36
Bitrix\Main\Engine\CurrentUser
Определения
currentuser.php:8
$result
$result
Определения
get_property_values.php:14
Bitrix\Im\V2\Chat
Bitrix\Im\V2\Controller\Chat
Определения
Anchor.php:5
bitrix
modules
im
lib
V2
Controller
Chat
Anchor.php
Создано системой
1.14.0