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:41d8acdc31465a852930f88cf1604224)
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
79 * is this the default message template for the workflow referenced by workflow_id?
86 * is this the reserved message template which we ship for the workflow referenced by workflow_id?
93 * Is this message template used for sms?
100 * a pseudo-FK to civicrm_option_value containing PDF Page Format.
104 public $pdf_format_id;
109 public function __construct() {
110 $this->__table
= 'civicrm_msg_template';
111 parent
::__construct();
115 * Returns all the column names of this table
119 public static function &fields() {
120 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
121 Civi
::$statics[__CLASS__
]['fields'] = [
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('Message Template ID'),
126 'description' => ts('Message Template ID'),
128 'where' => 'civicrm_msg_template.id',
129 'table_name' => 'civicrm_msg_template',
130 'entity' => 'MessageTemplate',
131 'bao' => 'CRM_Core_BAO_MessageTemplate',
135 'name' => 'msg_title',
136 'type' => CRM_Utils_Type
::T_STRING
,
137 'title' => ts('Message Template Title'),
138 'description' => ts('Descriptive title of message'),
140 'size' => CRM_Utils_Type
::HUGE
,
141 'where' => 'civicrm_msg_template.msg_title',
142 'table_name' => 'civicrm_msg_template',
143 'entity' => 'MessageTemplate',
144 'bao' => 'CRM_Core_BAO_MessageTemplate',
148 'name' => 'msg_subject',
149 'type' => CRM_Utils_Type
::T_TEXT
,
150 'title' => ts('Message Template Subject'),
151 'description' => ts('Subject for email message.'),
152 'where' => 'civicrm_msg_template.msg_subject',
153 'table_name' => 'civicrm_msg_template',
154 'entity' => 'MessageTemplate',
155 'bao' => 'CRM_Core_BAO_MessageTemplate',
159 'name' => 'msg_text',
160 'type' => CRM_Utils_Type
::T_LONGTEXT
,
161 'title' => ts('Message Template Text'),
162 'description' => ts('Text formatted message'),
163 'where' => 'civicrm_msg_template.msg_text',
164 'table_name' => 'civicrm_msg_template',
165 'entity' => 'MessageTemplate',
166 'bao' => 'CRM_Core_BAO_MessageTemplate',
169 'type' => 'TextArea',
173 'name' => 'msg_html',
174 'type' => CRM_Utils_Type
::T_LONGTEXT
,
175 'title' => ts('Message Template HTML'),
176 'description' => ts('HTML formatted message'),
177 'where' => 'civicrm_msg_template.msg_html',
178 'table_name' => 'civicrm_msg_template',
179 'entity' => 'MessageTemplate',
180 'bao' => 'CRM_Core_BAO_MessageTemplate',
183 'type' => 'RichTextEditor',
187 'name' => 'is_active',
188 'type' => CRM_Utils_Type
::T_BOOLEAN
,
189 'title' => ts('Is Active'),
190 'where' => 'civicrm_msg_template.is_active',
192 'table_name' => 'civicrm_msg_template',
193 'entity' => 'MessageTemplate',
194 'bao' => 'CRM_Core_BAO_MessageTemplate',
198 'name' => 'workflow_id',
199 'type' => CRM_Utils_Type
::T_INT
,
200 'title' => ts('Message Template Workflow'),
201 'description' => ts('a pseudo-FK to civicrm_option_value'),
202 'where' => 'civicrm_msg_template.workflow_id',
203 'table_name' => 'civicrm_msg_template',
204 'entity' => 'MessageTemplate',
205 'bao' => 'CRM_Core_BAO_MessageTemplate',
209 'name' => 'is_default',
210 'type' => CRM_Utils_Type
::T_BOOLEAN
,
211 'title' => ts('Message Template Is Default?'),
212 'description' => ts('is this the default message template for the workflow referenced by workflow_id?'),
213 'where' => 'civicrm_msg_template.is_default',
215 'table_name' => 'civicrm_msg_template',
216 'entity' => 'MessageTemplate',
217 'bao' => 'CRM_Core_BAO_MessageTemplate',
221 'name' => 'is_reserved',
222 'type' => CRM_Utils_Type
::T_BOOLEAN
,
223 'title' => ts('Message Template Is Reserved?'),
224 'description' => ts('is this the reserved message template which we ship for the workflow referenced by workflow_id?'),
225 'where' => 'civicrm_msg_template.is_reserved',
226 'table_name' => 'civicrm_msg_template',
227 'entity' => 'MessageTemplate',
228 'bao' => 'CRM_Core_BAO_MessageTemplate',
233 'type' => CRM_Utils_Type
::T_BOOLEAN
,
234 'title' => ts('Message Template is used for SMS?'),
235 'description' => ts('Is this message template used for sms?'),
236 'where' => 'civicrm_msg_template.is_sms',
238 'table_name' => 'civicrm_msg_template',
239 'entity' => 'MessageTemplate',
240 'bao' => 'CRM_Core_BAO_MessageTemplate',
244 'name' => 'pdf_format_id',
245 'type' => CRM_Utils_Type
::T_INT
,
246 'title' => ts('Message Template Format'),
247 'description' => ts('a pseudo-FK to civicrm_option_value containing PDF Page Format.'),
248 'where' => 'civicrm_msg_template.pdf_format_id',
249 'table_name' => 'civicrm_msg_template',
250 'entity' => 'MessageTemplate',
251 'bao' => 'CRM_Core_BAO_MessageTemplate',
253 'pseudoconstant' => [
254 'optionGroupName' => 'pdf_format',
256 'optionEditPath' => 'civicrm/admin/options/pdf_format',
260 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
262 return Civi
::$statics[__CLASS__
]['fields'];
266 * Return a mapping from field-name to the corresponding key (as used in fields()).
269 * Array(string $name => string $uniqueName).
271 public static function &fieldKeys() {
272 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
273 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
275 return Civi
::$statics[__CLASS__
]['fieldKeys'];
279 * Returns the names of this table
283 public static function getTableName() {
284 return self
::$_tableName;
288 * Returns if this table needs to be logged
292 public function getLog() {
297 * Returns the list of fields that can be imported
299 * @param bool $prefix
303 public static function &import($prefix = FALSE) {
304 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'msg_template', $prefix, []);
309 * Returns the list of fields that can be exported
311 * @param bool $prefix
315 public static function &export($prefix = FALSE) {
316 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'msg_template', $prefix, []);
321 * Returns the list of indices
323 * @param bool $localize
327 public static function indices($localize = TRUE) {
329 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;