ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
18  protected $title = '';
19 
23  protected $context = '';
24 
28  protected $lang = '';
29 
33  protected $m_subject = '';
34 
38  protected $m_message = '';
39 
43  protected $db;
44 
48  public function __construct($data = null)
49  {
50  global $DIC;
51 
52  $this->db = $DIC->database();
53 
54  if ($data) {
55  $this->setTplId($data['tpl_id']);
56  $this->setTitle($data['title']);
57  $this->setContext($data['context']);
58  $this->setLang($data['lang']);
59  $this->setSubject($data['m_subject']);
60  $this->setMessage($data['m_message']);
61  }
62  }
63 
67  public function getTplId()
68  {
69  return $this->tpl_id;
70  }
71 
75  public function setTplId($tpl_id)
76  {
77  $this->tpl_id = $tpl_id;
78  }
79 
83  public function getTitle()
84  {
85  return $this->title;
86  }
87 
91  public function setTitle($title)
92  {
93  $this->title = $title;
94  }
95 
99  public function getContext()
100  {
101  return $this->context;
102  }
103 
107  public function setContext($context)
108  {
109  $this->context = $context;
110  }
111 
115  public function getLang()
116  {
117  return $this->lang;
118  }
119 
123  public function setLang($lang)
124  {
125  $this->lang = $lang;
126  }
127 
131  public function getSubject()
132  {
133  return $this->m_subject;
134  }
135 
139  public function setSubject($m_subject)
140  {
141  $this->m_subject = $m_subject;
142  }
143 
147  public function getMessage()
148  {
149  return $this->m_message;
150  }
151 
155  public function setMessage($m_message)
156  {
157  $this->m_message = $m_message;
158  }
159 
160  public function insert()
161  {
162  $next_id = $this->db->nextId('mail_man_tpl');
163  $this->db->insert('mail_man_tpl', array(
164  'tpl_id' => array('integer', $next_id),
165  'title' => array('text', $this->getTitle()),
166  'context' => array('text', $this->getContext()),
167  'lang' => array('text', $this->getLang()),
168  'm_subject' => array('text', $this->getSubject()),
169  'm_message' => array('text', $this->getMessage())
170  ));
171  }
172 
173  public function update()
174  {
175  $this->db->update(
176  'mail_man_tpl',
177  array(
178  'title' => array('text', $this->getTitle()),
179  'context' => array('text', $this->getContext()),
180  'lang' => array('text', $this->getLang()),
181  'm_subject' => array('text', $this->getSubject()),
182  'm_message' => array('text', $this->getMessage())
183  ),
184  array(
185  'tpl_id' => array('integer', $this->getTplId()),
186  )
187  );
188  }
189 
193  public function delete($tpl_ids = array())
194  {
195  }
196 }
global $DIC
Definition: saml.php:7
Class ilMailTemplate.
Create styles array
The data for the language used.