ILIAS  release_8 Revision v8.24
class.ilMailTemplate.php
Go to the documentation of this file.
1<?php
2
19declare(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
48 public function toArray(): array
49 {
50 return [
51 'tpl_id' => $this->getTplId(),
52 'title' => $this->getTitle(),
53 'context' => $this->getContext(),
54 'lang' => $this->getLang(),
55 'm_subject' => $this->getSubject(),
56 'm_message' => $this->getMessage(),
57 'is_default' => $this->isDefault(),
58 ];
59 }
60
61 public function getTplId(): int
62 {
63 return $this->templateId;
64 }
65
66 public function setTplId(int $templateId): void
67 {
68 $this->templateId = $templateId;
69 }
70
71 public function getTitle(): string
72 {
73 return $this->title;
74 }
75
76 public function setTitle(string $title): void
77 {
78 $this->title = $title;
79 }
80
81 public function getContext(): string
82 {
83 return $this->context;
84 }
85
86 public function setContext(string $context): void
87 {
88 $this->context = $context;
89 }
90
91 public function getLang(): string
92 {
93 return $this->lang;
94 }
95
96 public function setLang(string $lang): void
97 {
98 $this->lang = $lang;
99 }
100
101 public function getSubject(): string
102 {
103 return $this->subject;
104 }
105
106 public function setSubject(string $subject): void
107 {
108 $this->subject = $subject;
109 }
110
111 public function getMessage(): string
112 {
113 return $this->message;
114 }
115
116 public function setMessage(string $message): void
117 {
118 $this->message = $message;
119 }
120
121 public function isDefault(): bool
122 {
123 return $this->isDefault;
124 }
125
126 public function setAsDefault(bool $isDefault): void
127 {
128 $this->isDefault = $isDefault;
129 }
130}
Class ilMailTemplate.
setAsDefault(bool $isDefault)
setContext(string $context)
setTplId(int $templateId)
__construct(array $data=null)
setTitle(string $title)
setMessage(string $message)
setSubject(string $subject)
setLang(string $lang)