Set version to 4.7.19
[civicrm-core.git] / CRM / Core / DAO / MessageTemplate.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
10| CiviCRM is free software; you can copy, modify, and distribute it |
11| under the terms of the GNU Affero General Public License |
12| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13| |
14| CiviCRM is distributed in the hope that it will be useful, but |
15| WITHOUT ANY WARRANTY; without even the implied warranty of |
16| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17| See the GNU Affero General Public License for more details. |
18| |
19| You should have received a copy of the GNU Affero General Public |
20| License and the CiviCRM Licensing Exception along |
21| with this program; if not, contact CiviCRM LLC |
22| at info[AT]civicrm[DOT]org. If you have questions about the |
23| GNU Affero General Public License or the licensing of CiviCRM, |
24| see the CiviCRM license FAQ at http://civicrm.org/licensing |
25+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Core/MessageTemplate.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
522a26c9 33 * (GenCodeChecksum:eb871e98ab4f44d12853c54bd78c8077)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Core_DAO_MessageTemplate constructor.
39 */
e501603b
TO
40class CRM_Core_DAO_MessageTemplate extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_msg_template';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 * Message Template ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Descriptive title of message
61 *
62 * @var string
63 */
64 public $msg_title;
65 /**
66 * Subject for email message.
67 *
68 * @var text
69 */
70 public $msg_subject;
71 /**
72 * Text formatted message
73 *
74 * @var longtext
75 */
76 public $msg_text;
77 /**
78 * HTML formatted message
79 *
80 * @var longtext
81 */
82 public $msg_html;
83 /**
84 *
85 * @var boolean
86 */
87 public $is_active;
88 /**
89 * a pseudo-FK to civicrm_option_value
90 *
91 * @var int unsigned
92 */
93 public $workflow_id;
94 /**
95 * is this the default message template for the workflow referenced by workflow_id?
96 *
97 * @var boolean
98 */
99 public $is_default;
100 /**
101 * is this the reserved message template which we ship for the workflow referenced by workflow_id?
102 *
103 * @var boolean
104 */
105 public $is_reserved;
106 /**
107 * Is this message template used for sms?
108 *
109 * @var boolean
110 */
111 public $is_sms;
112 /**
113 * a pseudo-FK to civicrm_option_value containing PDF Page Format.
114 *
115 * @var int unsigned
116 */
117 public $pdf_format_id;
118 /**
f41f0342 119 * Class constructor.
e501603b
TO
120 */
121 function __construct() {
122 $this->__table = 'civicrm_msg_template';
123 parent::__construct();
124 }
125 /**
126 * Returns all the column names of this table
127 *
128 * @return array
129 */
130 static function &fields() {
346aaaba
TO
131 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
132 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
133 'id' => array(
134 'name' => 'id',
135 'type' => CRM_Utils_Type::T_INT,
136 'title' => ts('Message Template ID') ,
137 'description' => 'Message Template ID',
138 'required' => true,
522a26c9 139 'table_name' => 'civicrm_msg_template',
140 'entity' => 'MessageTemplate',
141 'bao' => 'CRM_Core_BAO_MessageTemplate',
e501603b
TO
142 ) ,
143 'msg_title' => array(
144 'name' => 'msg_title',
145 'type' => CRM_Utils_Type::T_STRING,
146 'title' => ts('Message Template Title') ,
147 'description' => 'Descriptive title of message',
148 'maxlength' => 255,
149 'size' => CRM_Utils_Type::HUGE,
522a26c9 150 'table_name' => 'civicrm_msg_template',
151 'entity' => 'MessageTemplate',
152 'bao' => 'CRM_Core_BAO_MessageTemplate',
e501603b
TO
153 ) ,
154 'msg_subject' => array(
155 'name' => 'msg_subject',
156 'type' => CRM_Utils_Type::T_TEXT,
157 'title' => ts('Message Template Subject') ,
158 'description' => 'Subject for email message.',
522a26c9 159 'table_name' => 'civicrm_msg_template',
160 'entity' => 'MessageTemplate',
161 'bao' => 'CRM_Core_BAO_MessageTemplate',
e501603b
TO
162 ) ,
163 'msg_text' => array(
164 'name' => 'msg_text',
165 'type' => CRM_Utils_Type::T_LONGTEXT,
166 'title' => ts('Message Template Text') ,
167 'description' => 'Text formatted message',
522a26c9 168 'table_name' => 'civicrm_msg_template',
169 'entity' => 'MessageTemplate',
170 'bao' => 'CRM_Core_BAO_MessageTemplate',
e501603b
TO
171 'html' => array(
172 'type' => 'TextArea',
173 ) ,
174 ) ,
175 'msg_html' => array(
176 'name' => 'msg_html',
177 'type' => CRM_Utils_Type::T_LONGTEXT,
178 'title' => ts('Message Template HTML') ,
179 'description' => 'HTML formatted message',
522a26c9 180 'table_name' => 'civicrm_msg_template',
181 'entity' => 'MessageTemplate',
182 'bao' => 'CRM_Core_BAO_MessageTemplate',
e501603b
TO
183 'html' => array(
184 'type' => 'RichTextEditor',
185 ) ,
186 ) ,
187 'is_active' => array(
188 'name' => 'is_active',
189 'type' => CRM_Utils_Type::T_BOOLEAN,
190 'title' => ts('Is Active') ,
191 'default' => '1',
522a26c9 192 'table_name' => 'civicrm_msg_template',
193 'entity' => 'MessageTemplate',
194 'bao' => 'CRM_Core_BAO_MessageTemplate',
e501603b
TO
195 ) ,
196 'workflow_id' => array(
197 'name' => 'workflow_id',
198 'type' => CRM_Utils_Type::T_INT,
199 'title' => ts('Message Template Workflow') ,
200 'description' => 'a pseudo-FK to civicrm_option_value',
522a26c9 201 'table_name' => 'civicrm_msg_template',
202 'entity' => 'MessageTemplate',
203 'bao' => 'CRM_Core_BAO_MessageTemplate',
e501603b
TO
204 ) ,
205 'is_default' => array(
206 'name' => 'is_default',
207 'type' => CRM_Utils_Type::T_BOOLEAN,
208 'title' => ts('Message Template Is Default?') ,
209 'description' => 'is this the default message template for the workflow referenced by workflow_id?',
210 'default' => '1',
522a26c9 211 'table_name' => 'civicrm_msg_template',
212 'entity' => 'MessageTemplate',
213 'bao' => 'CRM_Core_BAO_MessageTemplate',
e501603b
TO
214 ) ,
215 'is_reserved' => array(
216 'name' => 'is_reserved',
217 'type' => CRM_Utils_Type::T_BOOLEAN,
218 'title' => ts('Message Template Is Reserved?') ,
219 'description' => 'is this the reserved message template which we ship for the workflow referenced by workflow_id?',
522a26c9 220 'table_name' => 'civicrm_msg_template',
221 'entity' => 'MessageTemplate',
222 'bao' => 'CRM_Core_BAO_MessageTemplate',
e501603b
TO
223 ) ,
224 'is_sms' => array(
225 'name' => 'is_sms',
226 'type' => CRM_Utils_Type::T_BOOLEAN,
227 'title' => ts('Message Template is used for SMS?') ,
228 'description' => 'Is this message template used for sms?',
522a26c9 229 'table_name' => 'civicrm_msg_template',
230 'entity' => 'MessageTemplate',
231 'bao' => 'CRM_Core_BAO_MessageTemplate',
e501603b
TO
232 ) ,
233 'pdf_format_id' => array(
234 'name' => 'pdf_format_id',
235 'type' => CRM_Utils_Type::T_INT,
236 'title' => ts('Message Template Format') ,
237 'description' => 'a pseudo-FK to civicrm_option_value containing PDF Page Format.',
522a26c9 238 'table_name' => 'civicrm_msg_template',
239 'entity' => 'MessageTemplate',
240 'bao' => 'CRM_Core_BAO_MessageTemplate',
e501603b
TO
241 'pseudoconstant' => array(
242 'optionGroupName' => 'pdf_format',
243 'keyColumn' => 'id',
244 'optionEditPath' => 'civicrm/admin/options/pdf_format',
245 )
246 ) ,
247 );
346aaaba 248 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 249 }
346aaaba 250 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
251 }
252 /**
bd8e0b14 253 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
254 *
255 * @return array
bd8e0b14 256 * Array(string $name => string $uniqueName).
e501603b
TO
257 */
258 static function &fieldKeys() {
bd8e0b14
TO
259 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
260 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 261 }
bd8e0b14 262 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
263 }
264 /**
265 * Returns the names of this table
266 *
267 * @return string
268 */
269 static function getTableName() {
270 return self::$_tableName;
271 }
272 /**
273 * Returns if this table needs to be logged
274 *
275 * @return boolean
276 */
277 function getLog() {
278 return self::$_log;
279 }
280 /**
281 * Returns the list of fields that can be imported
282 *
283 * @param bool $prefix
284 *
285 * @return array
286 */
287 static function &import($prefix = false) {
60808919
TO
288 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'msg_template', $prefix, array());
289 return $r;
e501603b
TO
290 }
291 /**
292 * Returns the list of fields that can be exported
293 *
294 * @param bool $prefix
295 *
296 * @return array
297 */
298 static function &export($prefix = false) {
60808919
TO
299 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'msg_template', $prefix, array());
300 return $r;
e501603b
TO
301 }
302}