1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Message.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Integration\AI\Dto;
4
5class Message implements \JsonSerializable
6{
15 public function __construct(
16 public readonly int $id,
17 public readonly string $text,
18 public readonly \Bitrix\Main\Type\DateTime $dateCreate,
19 public readonly string $authorName,
20 public readonly ?ForwardInfo $forwardInfo,
21 public readonly array $files,
22 public readonly ?Message $reply,
23 ) {}
24
25 public function setText(string $newText): self
26 {
27 return new Message(
28 $this->id,
29 $newText,
30 $this->dateCreate,
31 $this->authorName,
32 $this->forwardInfo,
33 $this->files,
34 $this->reply
35 );
36 }
37
38 public function setReply(Message $newReply): self
39 {
40 return new Message(
41 $this->id,
42 $this->text,
43 $this->dateCreate,
44 $this->authorName,
45 $this->forwardInfo,
46 $this->files,
47 $newReply
48 );
49 }
50
51 public function jsonSerialize(): array
52 {
53 $json = [
54 'id' => $this->id,
55 'text' => $this->text,
56 'date' => $this->dateCreate->format(\DateTime::ATOM),
57 'author' => $this->authorName,
58 ];
59
60 if ($this->forwardInfo !== null)
61 {
62 $json['forwardInfo'] = $this->forwardInfo;
63 }
64
65 if ($this->reply !== null)
66 {
67 $json['reply'] = $this->reply;
68 }
69
70 foreach ($this->files as $file)
71 {
72 $json['files'][] = $file;
73 }
74
75 return $json;
76 }
77}
setText(string $newText)
Определения Message.php:25
setReply(Message $newReply)
Определения Message.php:38
__construct(public readonly int $id, public readonly string $text, public readonly \Bitrix\Main\Type\DateTime $dateCreate, public readonly string $authorName, public readonly ?ForwardInfo $forwardInfo, public readonly array $files, public readonly ?Message $reply,)
Определения Message.php:15
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения collection.php:2
$files
Определения mysql_to_pgsql.php:30
$text
Определения template_pdf.php:79