ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
MailFolderData.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace 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 isSent(): bool
64  {
65  return $this->type === MailFolderType::SENT;
66  }
67 
68  public function isTrash(): bool
69  {
70  return $this->type === MailFolderType::TRASH;
71  }
72 
73  public function isUserLocalFolder(): bool
74  {
75  return $this->type === MailFolderType::LOCAL;
76  }
77 
78  public function isUserFolder(): bool
79  {
80  return $this->type === MailFolderType::USER;
81  }
82 
83  public function hasIncomingMails(): bool
84  {
85  return !$this->isDrafts() && !$this->isSent();
86  }
87 
88  public function hasOutgoingMails(): bool
89  {
90  return $this->isDrafts() || $this->isSent();
91  }
92 }
__construct(private readonly int $folder_id, private readonly int $user_id, private readonly MailFolderType $type, private readonly string $title)