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