ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
MailRecordData.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Mail\Message;
22
23use DateTimeImmutable;
24
26{
27 public const string STATUS_READ = 'read';
28 public const string STATUS_UNREAD = 'unread';
29
30 public function __construct(
31 private readonly int $mail_id,
32 private readonly int $user_id,
33 private readonly int $folder_id,
34 private readonly ?int $sender_id = null,
35 private readonly ?DateTimeImmutable $send_time = null,
36 private readonly ?string $status = null,
37 private readonly ?string $subject = null,
38 private readonly ?string $import_name = null,
39 private readonly ?bool $use_placeholders = false,
40 private readonly ?string $message = null,
41 private readonly ?string $rcp_to = null,
42 private readonly ?string $rcp_cc = null,
43 private readonly ?string $rcp_bc = null,
44 private readonly ?array $attachments = [],
45 private readonly ?string $tpl_ctx_id = null,
46 private readonly ?string $tpl_ctx_params = null
47 ) {
48 }
49
50 public function getMailId(): int
51 {
52 return $this->mail_id;
53 }
54
55 public function getUserId(): int
56 {
57 return $this->user_id;
58 }
59
60 public function getFolderId(): int
61 {
62 return $this->folder_id;
63 }
64
65 public function getSenderId(): ?int
66 {
67 return $this->sender_id;
68 }
69
70 public function getSendTime(): ?DateTimeImmutable
71 {
72 return $this->send_time;
73 }
74
75 public function getStatus(): ?string
76 {
77 return $this->status;
78 }
79
80 public function getSubject(): ?string
81 {
82 return $this->subject;
83 }
84
85 public function getImportName(): ?string
86 {
87 return $this->import_name;
88 }
89
90 public function getUsePlaceholders(): ?bool
91 {
92 return $this->use_placeholders;
93 }
94
95 public function getMessage(): ?string
96 {
97 return $this->message;
98 }
99
100 public function getRcpTo(): ?string
101 {
102 return $this->rcp_to;
103 }
104
105 public function getRcpCc(): ?string
106 {
107 return $this->rcp_cc;
108 }
109
110 public function getRcpBc(): ?string
111 {
112 return $this->rcp_bc;
113 }
114
118 public function getAttachments(): ?array
119 {
120 return $this->attachments;
121 }
122
123 public function getTplCtxId(): ?string
124 {
125 return $this->tpl_ctx_id;
126 }
127
128 public function getTplCtxParams(): ?string
129 {
130 return $this->tpl_ctx_params;
131 }
132
133 public function isRead(): bool
134 {
135 return $this->status === self::STATUS_READ;
136 }
137
138 public function hasAttachments(): bool
139 {
140 return !empty($this->attachments);
141 }
142
143 public function hasPersonalSender(): bool
144 {
145 return $this->sender_id !== null && $this->sender_id !== ANONYMOUS_USER_ID;
146 }
147}
__construct(private readonly int $mail_id, private readonly int $user_id, private readonly int $folder_id, private readonly ?int $sender_id=null, private readonly ?DateTimeImmutable $send_time=null, private readonly ?string $status=null, private readonly ?string $subject=null, private readonly ?string $import_name=null, private readonly ?bool $use_placeholders=false, private readonly ?string $message=null, private readonly ?string $rcp_to=null, private readonly ?string $rcp_cc=null, private readonly ?string $rcp_bc=null, private readonly ?array $attachments=[], private readonly ?string $tpl_ctx_id=null, private readonly ?string $tpl_ctx_params=null)
const ANONYMOUS_USER_ID
Definition: constants.php:27
$message
Definition: xapiexit.php:31