ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilMailTemplate.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
11 protected $templateId = 0;
12
14 protected $title = '';
15
16 /*** @var string */
17 protected $context = '';
18
20 protected $lang = '';
21
23 protected $subject = '';
24
26 protected $message = '';
27
29 protected $isDefault = false;
30
34 public function __construct(array $data = null)
35 {
36 if (is_array($data)) {
37 $this->setTplId((int) $data['tpl_id']);
38 $this->setTitle((string) $data['title']);
39 $this->setContext((string) $data['context']);
40 $this->setLang((string) $data['lang']);
41 $this->setSubject((string) $data['m_subject']);
42 $this->setMessage((string) $data['m_message']);
43 $this->setAsDefault((bool) $data['is_default']);
44 }
45 }
46
50 public function toArray() : array
51 {
52 return [
53 'tpl_id' => $this->getTplId(),
54 'title' => $this->getTitle(),
55 'context' => $this->getContext(),
56 'lang' => $this->getLang(),
57 'm_subject' => $this->getSubject(),
58 'm_message' => $this->getMessage(),
59 'is_default' => $this->isDefault(),
60 ];
61 }
62
66 public function getTplId() : int
67 {
68 return $this->templateId;
69 }
70
74 public function setTplId(int $templateId)
75 {
76 $this->templateId = $templateId;
77 }
78
82 public function getTitle() : string
83 {
84 return $this->title;
85 }
86
90 public function setTitle(string $title)
91 {
92 $this->title = $title;
93 }
94
98 public function getContext() : string
99 {
100 return $this->context;
101 }
102
106 public function setContext(string $context)
107 {
108 $this->context = $context;
109 }
110
114 public function getLang() : string
115 {
116 return $this->lang;
117 }
118
122 public function setLang(string $lang)
123 {
124 $this->lang = $lang;
125 }
126
130 public function getSubject() : string
131 {
132 return $this->subject;
133 }
134
138 public function setSubject(string $subject)
139 {
140 $this->subject = $subject;
141 }
142
146 public function getMessage() : string
147 {
148 return $this->message;
149 }
150
154 public function setMessage(string $message)
155 {
156 $this->message = $message;
157 }
158
162 public function isDefault() : bool
163 {
164 return $this->isDefault;
165 }
166
170 public function setAsDefault(bool $isDefault)
171 {
172 $this->isDefault = $isDefault;
173 }
174}
An exception for terminatinating execution or to throw for unit testing.
Class ilMailTemplate.
setAsDefault(bool $isDefault)
setContext(string $context)
setTplId(int $templateId)
__construct(array $data=null)
setTitle(string $title)
setMessage(string $message)
setSubject(string $subject)
$data
Definition: storeScorm.php:23