5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/MessageTemplate.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:90ed9b8ad7299f01d2f83ea90b7b7a15)
13 * Database access object for the MessageTemplate entity.
15 class CRM_Core_DAO_MessageTemplate
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_msg_template';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Descriptive title of message
46 * Subject for email message.
53 * Text formatted message
60 * HTML formatted message
72 * a pseudo-FK to civicrm_option_value
81 public $workflow_name;
84 * is this the default message template for the workflow referenced by workflow_id?
91 * is this the reserved message template which we ship for the workflow referenced by workflow_id?
98 * Is this message template used for sms?
105 * a pseudo-FK to civicrm_option_value containing PDF Page Format.
109 public $pdf_format_id;
114 public function __construct() {
115 $this->__table
= 'civicrm_msg_template';
116 parent
::__construct();
120 * Returns all the column names of this table
124 public static function &fields() {
125 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
126 Civi
::$statics[__CLASS__
]['fields'] = [
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Message Template ID'),
131 'description' => ts('Message Template ID'),
133 'where' => 'civicrm_msg_template.id',
134 'table_name' => 'civicrm_msg_template',
135 'entity' => 'MessageTemplate',
136 'bao' => 'CRM_Core_BAO_MessageTemplate',
140 'name' => 'msg_title',
141 'type' => CRM_Utils_Type
::T_STRING
,
142 'title' => ts('Message Template Title'),
143 'description' => ts('Descriptive title of message'),
145 'size' => CRM_Utils_Type
::HUGE
,
146 'where' => 'civicrm_msg_template.msg_title',
147 'table_name' => 'civicrm_msg_template',
148 'entity' => 'MessageTemplate',
149 'bao' => 'CRM_Core_BAO_MessageTemplate',
153 'name' => 'msg_subject',
154 'type' => CRM_Utils_Type
::T_TEXT
,
155 'title' => ts('Message Template Subject'),
156 'description' => ts('Subject for email message.'),
157 'where' => 'civicrm_msg_template.msg_subject',
158 'table_name' => 'civicrm_msg_template',
159 'entity' => 'MessageTemplate',
160 'bao' => 'CRM_Core_BAO_MessageTemplate',
164 'name' => 'msg_text',
165 'type' => CRM_Utils_Type
::T_LONGTEXT
,
166 'title' => ts('Message Template Text'),
167 'description' => ts('Text formatted message'),
168 'where' => 'civicrm_msg_template.msg_text',
169 'table_name' => 'civicrm_msg_template',
170 'entity' => 'MessageTemplate',
171 'bao' => 'CRM_Core_BAO_MessageTemplate',
174 'type' => 'TextArea',
178 'name' => 'msg_html',
179 'type' => CRM_Utils_Type
::T_LONGTEXT
,
180 'title' => ts('Message Template HTML'),
181 'description' => ts('HTML formatted message'),
182 'where' => 'civicrm_msg_template.msg_html',
183 'table_name' => 'civicrm_msg_template',
184 'entity' => 'MessageTemplate',
185 'bao' => 'CRM_Core_BAO_MessageTemplate',
188 'type' => 'RichTextEditor',
192 'name' => 'is_active',
193 'type' => CRM_Utils_Type
::T_BOOLEAN
,
194 'title' => ts('Is Active'),
195 'where' => 'civicrm_msg_template.is_active',
197 'table_name' => 'civicrm_msg_template',
198 'entity' => 'MessageTemplate',
199 'bao' => 'CRM_Core_BAO_MessageTemplate',
203 'name' => 'workflow_id',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Deprecated field for Message Template Workflow.'),
206 'description' => ts('a pseudo-FK to civicrm_option_value'),
207 'where' => 'civicrm_msg_template.workflow_id',
208 'table_name' => 'civicrm_msg_template',
209 'entity' => 'MessageTemplate',
210 'bao' => 'CRM_Core_BAO_MessageTemplate',
214 'name' => 'workflow_name',
215 'type' => CRM_Utils_Type
::T_STRING
,
216 'title' => ts('Message Template Workflow Name'),
218 'size' => CRM_Utils_Type
::HUGE
,
219 'where' => 'civicrm_msg_template.workflow_name',
220 'table_name' => 'civicrm_msg_template',
221 'entity' => 'MessageTemplate',
222 'bao' => 'CRM_Core_BAO_MessageTemplate',
226 'name' => 'is_default',
227 'type' => CRM_Utils_Type
::T_BOOLEAN
,
228 'title' => ts('Message Template Is Default?'),
229 'description' => ts('is this the default message template for the workflow referenced by workflow_id?'),
230 'where' => 'civicrm_msg_template.is_default',
232 'table_name' => 'civicrm_msg_template',
233 'entity' => 'MessageTemplate',
234 'bao' => 'CRM_Core_BAO_MessageTemplate',
238 'name' => 'is_reserved',
239 'type' => CRM_Utils_Type
::T_BOOLEAN
,
240 'title' => ts('Message Template Is Reserved?'),
241 'description' => ts('is this the reserved message template which we ship for the workflow referenced by workflow_id?'),
242 'where' => 'civicrm_msg_template.is_reserved',
243 'table_name' => 'civicrm_msg_template',
244 'entity' => 'MessageTemplate',
245 'bao' => 'CRM_Core_BAO_MessageTemplate',
250 'type' => CRM_Utils_Type
::T_BOOLEAN
,
251 'title' => ts('Message Template is used for SMS?'),
252 'description' => ts('Is this message template used for sms?'),
253 'where' => 'civicrm_msg_template.is_sms',
255 'table_name' => 'civicrm_msg_template',
256 'entity' => 'MessageTemplate',
257 'bao' => 'CRM_Core_BAO_MessageTemplate',
261 'name' => 'pdf_format_id',
262 'type' => CRM_Utils_Type
::T_INT
,
263 'title' => ts('Message Template Format'),
264 'description' => ts('a pseudo-FK to civicrm_option_value containing PDF Page Format.'),
265 'where' => 'civicrm_msg_template.pdf_format_id',
266 'table_name' => 'civicrm_msg_template',
267 'entity' => 'MessageTemplate',
268 'bao' => 'CRM_Core_BAO_MessageTemplate',
270 'pseudoconstant' => [
271 'optionGroupName' => 'pdf_format',
273 'optionEditPath' => 'civicrm/admin/options/pdf_format',
277 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
279 return Civi
::$statics[__CLASS__
]['fields'];
283 * Return a mapping from field-name to the corresponding key (as used in fields()).
286 * Array(string $name => string $uniqueName).
288 public static function &fieldKeys() {
289 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
290 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
292 return Civi
::$statics[__CLASS__
]['fieldKeys'];
296 * Returns the names of this table
300 public static function getTableName() {
301 return self
::$_tableName;
305 * Returns if this table needs to be logged
309 public function getLog() {
314 * Returns the list of fields that can be imported
316 * @param bool $prefix
320 public static function &import($prefix = FALSE) {
321 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'msg_template', $prefix, []);
326 * Returns the list of fields that can be exported
328 * @param bool $prefix
332 public static function &export($prefix = FALSE) {
333 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'msg_template', $prefix, []);
338 * Returns the list of indices
340 * @param bool $localize
344 public static function indices($localize = TRUE) {
346 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;