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:542e52d6f757c9e8adfa2a5ed07b6475)
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 localized title of this entity.
122 public static function getEntityTitle() {
123 return ts('Message Templates');
127 * Returns all the column names of this table
131 public static function &fields() {
132 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
133 Civi
::$statics[__CLASS__
]['fields'] = [
136 'type' => CRM_Utils_Type
::T_INT
,
137 'title' => ts('Message Template ID'),
138 'description' => ts('Message Template ID'),
140 'where' => 'civicrm_msg_template.id',
141 'table_name' => 'civicrm_msg_template',
142 'entity' => 'MessageTemplate',
143 'bao' => 'CRM_Core_BAO_MessageTemplate',
148 'name' => 'msg_title',
149 'type' => CRM_Utils_Type
::T_STRING
,
150 'title' => ts('Message Template Title'),
151 'description' => ts('Descriptive title of message'),
153 'size' => CRM_Utils_Type
::HUGE
,
154 'where' => 'civicrm_msg_template.msg_title',
155 'table_name' => 'civicrm_msg_template',
156 'entity' => 'MessageTemplate',
157 'bao' => 'CRM_Core_BAO_MessageTemplate',
162 'name' => 'msg_subject',
163 'type' => CRM_Utils_Type
::T_TEXT
,
164 'title' => ts('Message Template Subject'),
165 'description' => ts('Subject for email message.'),
166 'where' => 'civicrm_msg_template.msg_subject',
167 'table_name' => 'civicrm_msg_template',
168 'entity' => 'MessageTemplate',
169 'bao' => 'CRM_Core_BAO_MessageTemplate',
174 'name' => 'msg_text',
175 'type' => CRM_Utils_Type
::T_LONGTEXT
,
176 'title' => ts('Message Template Text'),
177 'description' => ts('Text formatted message'),
178 'where' => 'civicrm_msg_template.msg_text',
179 'table_name' => 'civicrm_msg_template',
180 'entity' => 'MessageTemplate',
181 'bao' => 'CRM_Core_BAO_MessageTemplate',
184 'type' => 'TextArea',
189 'name' => 'msg_html',
190 'type' => CRM_Utils_Type
::T_LONGTEXT
,
191 'title' => ts('Message Template HTML'),
192 'description' => ts('HTML formatted message'),
193 'where' => 'civicrm_msg_template.msg_html',
194 'table_name' => 'civicrm_msg_template',
195 'entity' => 'MessageTemplate',
196 'bao' => 'CRM_Core_BAO_MessageTemplate',
199 'type' => 'RichTextEditor',
204 'name' => 'is_active',
205 'type' => CRM_Utils_Type
::T_BOOLEAN
,
206 'title' => ts('Is Active'),
207 'where' => 'civicrm_msg_template.is_active',
209 'table_name' => 'civicrm_msg_template',
210 'entity' => 'MessageTemplate',
211 'bao' => 'CRM_Core_BAO_MessageTemplate',
216 'name' => 'workflow_id',
217 'type' => CRM_Utils_Type
::T_INT
,
218 'title' => ts('Deprecated field for Message Template Workflow.'),
219 'description' => ts('a pseudo-FK to civicrm_option_value'),
220 'where' => 'civicrm_msg_template.workflow_id',
221 'table_name' => 'civicrm_msg_template',
222 'entity' => 'MessageTemplate',
223 'bao' => 'CRM_Core_BAO_MessageTemplate',
228 'name' => 'workflow_name',
229 'type' => CRM_Utils_Type
::T_STRING
,
230 'title' => ts('Message Template Workflow Name'),
232 'size' => CRM_Utils_Type
::HUGE
,
233 'where' => 'civicrm_msg_template.workflow_name',
234 'table_name' => 'civicrm_msg_template',
235 'entity' => 'MessageTemplate',
236 'bao' => 'CRM_Core_BAO_MessageTemplate',
241 'name' => 'is_default',
242 'type' => CRM_Utils_Type
::T_BOOLEAN
,
243 'title' => ts('Message Template Is Default?'),
244 'description' => ts('is this the default message template for the workflow referenced by workflow_id?'),
245 'where' => 'civicrm_msg_template.is_default',
247 'table_name' => 'civicrm_msg_template',
248 'entity' => 'MessageTemplate',
249 'bao' => 'CRM_Core_BAO_MessageTemplate',
254 'name' => 'is_reserved',
255 'type' => CRM_Utils_Type
::T_BOOLEAN
,
256 'title' => ts('Message Template Is Reserved?'),
257 'description' => ts('is this the reserved message template which we ship for the workflow referenced by workflow_id?'),
258 'where' => 'civicrm_msg_template.is_reserved',
259 'table_name' => 'civicrm_msg_template',
260 'entity' => 'MessageTemplate',
261 'bao' => 'CRM_Core_BAO_MessageTemplate',
267 'type' => CRM_Utils_Type
::T_BOOLEAN
,
268 'title' => ts('Message Template is used for SMS?'),
269 'description' => ts('Is this message template used for sms?'),
270 'where' => 'civicrm_msg_template.is_sms',
272 'table_name' => 'civicrm_msg_template',
273 'entity' => 'MessageTemplate',
274 'bao' => 'CRM_Core_BAO_MessageTemplate',
279 'name' => 'pdf_format_id',
280 'type' => CRM_Utils_Type
::T_INT
,
281 'title' => ts('Message Template Format'),
282 'description' => ts('a pseudo-FK to civicrm_option_value containing PDF Page Format.'),
283 'where' => 'civicrm_msg_template.pdf_format_id',
284 'table_name' => 'civicrm_msg_template',
285 'entity' => 'MessageTemplate',
286 'bao' => 'CRM_Core_BAO_MessageTemplate',
288 'pseudoconstant' => [
289 'optionGroupName' => 'pdf_format',
291 'optionEditPath' => 'civicrm/admin/options/pdf_format',
296 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
298 return Civi
::$statics[__CLASS__
]['fields'];
302 * Return a mapping from field-name to the corresponding key (as used in fields()).
305 * Array(string $name => string $uniqueName).
307 public static function &fieldKeys() {
308 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
309 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
311 return Civi
::$statics[__CLASS__
]['fieldKeys'];
315 * Returns the names of this table
319 public static function getTableName() {
320 return self
::$_tableName;
324 * Returns if this table needs to be logged
328 public function getLog() {
333 * Returns the list of fields that can be imported
335 * @param bool $prefix
339 public static function &import($prefix = FALSE) {
340 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'msg_template', $prefix, []);
345 * Returns the list of fields that can be exported
347 * @param bool $prefix
351 public static function &export($prefix = FALSE) {
352 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'msg_template', $prefix, []);
357 * Returns the list of indices
359 * @param bool $localize
363 public static function indices($localize = TRUE) {
365 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;