ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilMailTemplate.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
26 {
27  protected int $templateId = 0;
28  protected string $title = '';
29  protected string $context = '';
30  protected string $lang = '';
31  protected string $subject = '';
32  protected string $message = '';
33  protected bool $isDefault = false;
34 
35  public function __construct(?array $data = null)
36  {
37  if ($data) {
38  $this->setTplId((int) $data['tpl_id']);
39  $this->setTitle((string) $data['title']);
40  $this->setContext((string) $data['context']);
41  $this->setLang((string) $data['lang']);
42  $this->setSubject((string) $data['m_subject']);
43  $this->setMessage((string) $data['m_message']);
44  $this->setAsDefault((bool) $data['is_default']);
45  }
46  }
47 
51  public function toArray(): array
52  {
53  return [
54  'tpl_id' => $this->getTplId(),
55  'title' => $this->getTitle(),
56  'context' => $this->getContext(),
57  'lang' => $this->getLang(),
58  'm_subject' => $this->getSubject(),
59  'm_message' => $this->getMessage(),
60  'is_default' => $this->isDefault(),
61  ];
62  }
63 
64  public function getTplId(): int
65  {
66  return $this->templateId;
67  }
68 
69  public function setTplId(int $templateId): void
70  {
71  $this->templateId = $templateId;
72  }
73 
74  public function getTitle(): string
75  {
76  return $this->title;
77  }
78 
79  public function setTitle(string $title): void
80  {
81  $this->title = $title;
82  }
83 
84  public function getContext(): string
85  {
86  return $this->context;
87  }
88 
89  public function setContext(string $context): void
90  {
91  $this->context = $context;
92  }
93 
94  public function getLang(): string
95  {
96  return $this->lang;
97  }
98 
99  public function setLang(string $lang): void
100  {
101  $this->lang = $lang;
102  }
103 
104  public function getSubject(): string
105  {
106  return $this->subject;
107  }
108 
109  public function setSubject(string $subject): void
110  {
111  $this->subject = $subject;
112  }
113 
114  public function getMessage(): string
115  {
116  return $this->message;
117  }
118 
119  public function setMessage(string $message): void
120  {
121  $this->message = $message;
122  }
123 
124  public function isDefault(): bool
125  {
126  return $this->isDefault;
127  }
128 
129  public function setAsDefault(bool $isDefault): void
130  {
131  $this->isDefault = $isDefault;
132  }
133 }
setContext(string $context)
setAsDefault(bool $isDefault)
Class ilMailTemplate.
setTitle(string $title)
setLang(string $lang)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setMessage(string $message)
setTplId(int $templateId)
__construct(?array $data=null)
setSubject(string $subject)