ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
MailFolderData.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Mail\Folder;
22
24{
25 public function __construct(
26 private readonly int $folder_id,
27 private readonly int $user_id,
28 private readonly MailFolderType $type,
29 private readonly string $title
30 ) {
31 }
32
33 public function getFolderId(): int
34 {
35 return $this->folder_id;
36 }
37
38 public function getUserId(): int
39 {
40 return $this->user_id;
41 }
42
43 public function getTitle(): string
44 {
45 return $this->title;
46 }
47
48 public function getType(): MailFolderType
49 {
50 return $this->type;
51 }
52
53 public function isInbox(): bool
54 {
55 return $this->type === MailFolderType::INBOX;
56 }
57
58 public function isDrafts(): bool
59 {
60 return $this->type === MailFolderType::DRAFTS;
61 }
62
63 public function isOutbox(): bool
64 {
65 return $this->type === MailFolderType::OUTBOX;
66 }
67
68 public function isSent(): bool
69 {
70 return $this->type === MailFolderType::SENT;
71 }
72
73 public function isTrash(): bool
74 {
75 return $this->type === MailFolderType::TRASH;
76 }
77
78 public function isUserLocalFolder(): bool
79 {
80 return $this->type === MailFolderType::LOCAL;
81 }
82
83 public function isUserFolder(): bool
84 {
85 return $this->type === MailFolderType::USER;
86 }
87
88 public function hasIncomingMails(): bool
89 {
90 return !$this->isDrafts() && !$this->isSent() && !$this->isOutbox();
91 }
92
93 public function hasOutgoingMails(): bool
94 {
95 return $this->isDrafts() || $this->isSent() || $this->isOutbox();
96 }
97}
__construct(private readonly int $folder_id, private readonly int $user_id, private readonly MailFolderType $type, private readonly string $title)