1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Anchor.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
11
12final 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}
readAction(Chat $chat)
Определения Anchor.php:21
$result
Определения get_property_values.php:14