5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/MessageTemplate.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:988d404fbe6cd84e14a175f71b3f8440)
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 static $_tableName = 'civicrm_msg_template';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_msg_template',
129 'entity' => 'MessageTemplate',
130 'bao' => 'CRM_Core_BAO_MessageTemplate',
134 'name' => 'msg_title',
135 'type' => CRM_Utils_Type
::T_STRING
,
136 'title' => ts('Message Template Title'),
137 'description' => ts('Descriptive title of message'),
139 'size' => CRM_Utils_Type
::HUGE
,
140 'table_name' => 'civicrm_msg_template',
141 'entity' => 'MessageTemplate',
142 'bao' => 'CRM_Core_BAO_MessageTemplate',
146 'name' => 'msg_subject',
147 'type' => CRM_Utils_Type
::T_TEXT
,
148 'title' => ts('Message Template Subject'),
149 'description' => ts('Subject for email message.'),
150 'table_name' => 'civicrm_msg_template',
151 'entity' => 'MessageTemplate',
152 'bao' => 'CRM_Core_BAO_MessageTemplate',
156 'name' => 'msg_text',
157 'type' => CRM_Utils_Type
::T_LONGTEXT
,
158 'title' => ts('Message Template Text'),
159 'description' => ts('Text formatted message'),
160 'table_name' => 'civicrm_msg_template',
161 'entity' => 'MessageTemplate',
162 'bao' => 'CRM_Core_BAO_MessageTemplate',
165 'type' => 'TextArea',
169 'name' => 'msg_html',
170 'type' => CRM_Utils_Type
::T_LONGTEXT
,
171 'title' => ts('Message Template HTML'),
172 'description' => ts('HTML formatted message'),
173 'table_name' => 'civicrm_msg_template',
174 'entity' => 'MessageTemplate',
175 'bao' => 'CRM_Core_BAO_MessageTemplate',
178 'type' => 'RichTextEditor',
182 'name' => 'is_active',
183 'type' => CRM_Utils_Type
::T_BOOLEAN
,
184 'title' => ts('Is Active'),
186 'table_name' => 'civicrm_msg_template',
187 'entity' => 'MessageTemplate',
188 'bao' => 'CRM_Core_BAO_MessageTemplate',
192 'name' => 'workflow_id',
193 'type' => CRM_Utils_Type
::T_INT
,
194 'title' => ts('Message Template Workflow'),
195 'description' => ts('a pseudo-FK to civicrm_option_value'),
196 'table_name' => 'civicrm_msg_template',
197 'entity' => 'MessageTemplate',
198 'bao' => 'CRM_Core_BAO_MessageTemplate',
202 'name' => 'is_default',
203 'type' => CRM_Utils_Type
::T_BOOLEAN
,
204 'title' => ts('Message Template Is Default?'),
205 'description' => ts('is this the default message template for the workflow referenced by workflow_id?'),
207 'table_name' => 'civicrm_msg_template',
208 'entity' => 'MessageTemplate',
209 'bao' => 'CRM_Core_BAO_MessageTemplate',
213 'name' => 'is_reserved',
214 'type' => CRM_Utils_Type
::T_BOOLEAN
,
215 'title' => ts('Message Template Is Reserved?'),
216 'description' => ts('is this the reserved message template which we ship for the workflow referenced by workflow_id?'),
217 'table_name' => 'civicrm_msg_template',
218 'entity' => 'MessageTemplate',
219 'bao' => 'CRM_Core_BAO_MessageTemplate',
224 'type' => CRM_Utils_Type
::T_BOOLEAN
,
225 'title' => ts('Message Template is used for SMS?'),
226 'description' => ts('Is this message template used for sms?'),
228 'table_name' => 'civicrm_msg_template',
229 'entity' => 'MessageTemplate',
230 'bao' => 'CRM_Core_BAO_MessageTemplate',
234 'name' => 'pdf_format_id',
235 'type' => CRM_Utils_Type
::T_INT
,
236 'title' => ts('Message Template Format'),
237 'description' => ts('a pseudo-FK to civicrm_option_value containing PDF Page Format.'),
238 'table_name' => 'civicrm_msg_template',
239 'entity' => 'MessageTemplate',
240 'bao' => 'CRM_Core_BAO_MessageTemplate',
242 'pseudoconstant' => [
243 'optionGroupName' => 'pdf_format',
245 'optionEditPath' => 'civicrm/admin/options/pdf_format',
249 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
251 return Civi
::$statics[__CLASS__
]['fields'];
255 * Return a mapping from field-name to the corresponding key (as used in fields()).
258 * Array(string $name => string $uniqueName).
260 public static function &fieldKeys() {
261 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
262 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
264 return Civi
::$statics[__CLASS__
]['fieldKeys'];
268 * Returns the names of this table
272 public static function getTableName() {
273 return self
::$_tableName;
277 * Returns if this table needs to be logged
281 public function getLog() {
286 * Returns the list of fields that can be imported
288 * @param bool $prefix
292 public static function &import($prefix = FALSE) {
293 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'msg_template', $prefix, []);
298 * Returns the list of fields that can be exported
300 * @param bool $prefix
304 public static function &export($prefix = FALSE) {
305 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'msg_template', $prefix, []);
310 * Returns the list of indices
312 * @param bool $localize
316 public static function indices($localize = TRUE) {
318 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;