1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
User.php
См. документацию.
1<?php
2declare(strict_types=1);
3
4namespace Bitrix\Im\V2\Message\Text\BbCode;
5
6use Bitrix\Im\V2\Entity;
7use Bitrix\Im\V2\Message\Text\ClosedBbCode;
8
9final class User extends ClosedBbCode
10{
11 private int $userId;
12
13 private function __construct(int $userId, string $innerText)
14 {
15 parent::__construct($innerText);
16 $this->userId = $userId;
17 }
18
19 public static function build(int $userId, string $innerText = ''): self
20 {
21 return new self($userId, $innerText);
22 }
23
24 protected function getValue(): ?string
25 {
26 return (string)$this->userId;
27 }
28
29 public function toPlain(): string
30 {
31 if ($this->innerText !== '')
32 {
33 return parent::toPlain();
34 }
35
36 $user = Entity\User\User::getInstance($this->userId);
37 if ($user instanceof Entity\User\NullUser)
38 {
39 return '';
40 }
41
42 return $user->getName() ?? '';
43 }
44
45 protected function getAdditionalParams(): array
46 {
47 return [];
48 }
49
50 public static function getName(): string
51 {
52 return 'USER';
53 }
54}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static getInstance(?int $id)
Определения User.php:72
static getName()
Определения User.php:50
static build(int $userId, string $innerText='')
Определения User.php:19
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения ufield.php:9
$user
Определения mysql_to_pgsql.php:33