ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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{
13 protected $tpl_id = 0;
14
15 /*
16 * @var string
17 */
18 protected $title = '';
19
20 /*
21 * @var string
22 */
23 protected $context = '';
24
25 /*
26 * @var string
27 */
28 protected $lang = '';
29
30 /*
31 * @var string
32 */
33 protected $m_subject = '';
34
35 /*
36 * @var string
37 */
38 protected $m_message = '';
39
43 public function __construct($data = NULL)
44 {
45 if($data)
46 {
47 $this->setTplId($data['tpl_id']);
48 $this->setTitle($data['title']);
49 $this->setContext($data['context']);
50 $this->setLang($data['lang']);
51 $this->setSubject($data['m_subject']);
52 $this->setMessage($data['m_message']);
53 }
54 }
55
59 public function getTplId()
60 {
61 return $this->tpl_id;
62 }
63
67 public function setTplId($tpl_id)
68 {
69 $this->tpl_id = $tpl_id;
70 }
71
75 public function getTitle()
76 {
77 return $this->title;
78 }
79
83 public function setTitle($title)
84 {
85 $this->title = $title;
86 }
87
91 public function getContext()
92 {
93 return $this->context;
94 }
95
99 public function setContext($context)
100 {
101 $this->context = $context;
102 }
103
107 public function getLang()
108 {
109 return $this->lang;
110 }
111
115 public function setLang($lang)
116 {
117 $this->lang = $lang;
118 }
119
123 public function getSubject()
124 {
125 return $this->m_subject;
126 }
127
131 public function setSubject($m_subject)
132 {
133 $this->m_subject = $m_subject;
134 }
135
139 public function getMessage()
140 {
141 return $this->m_message;
142 }
143
147 public function setMessage($m_message)
148 {
149 $this->m_message = $m_message;
150 }
151
152 public function insert()
153 {
154 global $ilDB;
155
156 $next_id = $ilDB->nextId('mail_man_tpl');
157 $ilDB->insert('mail_man_tpl', array(
158 'tpl_id' => array('integer', $next_id),
159 'title' => array('text', $this->getTitle()),
160 'context' => array('text', $this->getContext()),
161 'lang' => array('text', $this->getLang()),
162 'm_subject' => array('text', $this->getSubject()),
163 'm_message' => array('text', $this->getMessage())
164 ));
165 }
166
167 public function update()
168 {
169 global $ilDB;
170
171 $ilDB->update('mail_man_tpl',
172 array(
173 'title' => array('text', $this->getTitle()),
174 'context' => array('text', $this->getContext()),
175 'lang' => array('text', $this->getLang()),
176 'm_subject' => array('text', $this->getSubject()),
177 'm_message' => array('text', $this->getMessage())
178 ),
179 array(
180 'tpl_id' => array('integer', $this->getTplId()),
181 ));
182 }
183
187 public function delete($tpl_ids = array())
188 {
189
190 }
191}
Class ilMailTemplate.
$data
global $ilDB