5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/MessageTemplate.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:ca87344addd76f0aca31f53071a01238)
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' => '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' => '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' => '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' => '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' => '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' => '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' => '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' => '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' => 'Is this message template used for sms?',
227 'table_name' => 'civicrm_msg_template',
228 'entity' => 'MessageTemplate',
229 'bao' => 'CRM_Core_BAO_MessageTemplate',
233 'name' => 'pdf_format_id',
234 'type' => CRM_Utils_Type
::T_INT
,
235 'title' => ts('Message Template Format'),
236 'description' => 'a pseudo-FK to civicrm_option_value containing PDF Page Format.',
237 'table_name' => 'civicrm_msg_template',
238 'entity' => 'MessageTemplate',
239 'bao' => 'CRM_Core_BAO_MessageTemplate',
241 'pseudoconstant' => [
242 'optionGroupName' => 'pdf_format',
244 'optionEditPath' => 'civicrm/admin/options/pdf_format',
248 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
250 return Civi
::$statics[__CLASS__
]['fields'];
254 * Return a mapping from field-name to the corresponding key (as used in fields()).
257 * Array(string $name => string $uniqueName).
259 public static function &fieldKeys() {
260 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
261 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
263 return Civi
::$statics[__CLASS__
]['fieldKeys'];
267 * Returns the names of this table
271 public static function getTableName() {
272 return self
::$_tableName;
276 * Returns if this table needs to be logged
280 public function getLog() {
285 * Returns the list of fields that can be imported
287 * @param bool $prefix
291 public static function &import($prefix = FALSE) {
292 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'msg_template', $prefix, []);
297 * Returns the list of fields that can be exported
299 * @param bool $prefix
303 public static function &export($prefix = FALSE) {
304 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'msg_template', $prefix, []);
309 * Returns the list of indices
311 * @param bool $localize
315 public static function indices($localize = TRUE) {
317 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;