3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Core/MessageTemplate.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:ca87344addd76f0aca31f53071a01238)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_MessageTemplate constructor.
40 class CRM_Core_DAO_MessageTemplate
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_msg_template';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Descriptive title of message
66 * Subject for email message.
72 * Text formatted message
78 * HTML formatted message
89 * a pseudo-FK to civicrm_option_value
95 * is this the default message template for the workflow referenced by workflow_id?
101 * is this the reserved message template which we ship for the workflow referenced by workflow_id?
107 * Is this message template used for sms?
113 * a pseudo-FK to civicrm_option_value containing PDF Page Format.
117 public $pdf_format_id;
121 function __construct() {
122 $this->__table
= 'civicrm_msg_template';
123 parent
::__construct();
126 * Returns all the column names of this table
130 static function &fields() {
131 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
132 Civi
::$statics[__CLASS__
]['fields'] = array(
135 'type' => CRM_Utils_Type
::T_INT
,
136 'title' => ts('Message Template ID') ,
137 'description' => 'Message Template ID',
139 'table_name' => 'civicrm_msg_template',
140 'entity' => 'MessageTemplate',
141 'bao' => 'CRM_Core_BAO_MessageTemplate',
144 'msg_title' => array(
145 'name' => 'msg_title',
146 'type' => CRM_Utils_Type
::T_STRING
,
147 'title' => ts('Message Template Title') ,
148 'description' => 'Descriptive title of message',
150 'size' => CRM_Utils_Type
::HUGE
,
151 'table_name' => 'civicrm_msg_template',
152 'entity' => 'MessageTemplate',
153 'bao' => 'CRM_Core_BAO_MessageTemplate',
156 'msg_subject' => array(
157 'name' => 'msg_subject',
158 'type' => CRM_Utils_Type
::T_TEXT
,
159 'title' => ts('Message Template Subject') ,
160 'description' => 'Subject for email message.',
161 'table_name' => 'civicrm_msg_template',
162 'entity' => 'MessageTemplate',
163 'bao' => 'CRM_Core_BAO_MessageTemplate',
167 'name' => 'msg_text',
168 'type' => CRM_Utils_Type
::T_LONGTEXT
,
169 'title' => ts('Message Template Text') ,
170 'description' => 'Text formatted message',
171 'table_name' => 'civicrm_msg_template',
172 'entity' => 'MessageTemplate',
173 'bao' => 'CRM_Core_BAO_MessageTemplate',
176 'type' => 'TextArea',
180 'name' => 'msg_html',
181 'type' => CRM_Utils_Type
::T_LONGTEXT
,
182 'title' => ts('Message Template HTML') ,
183 'description' => 'HTML formatted message',
184 'table_name' => 'civicrm_msg_template',
185 'entity' => 'MessageTemplate',
186 'bao' => 'CRM_Core_BAO_MessageTemplate',
189 'type' => 'RichTextEditor',
192 'is_active' => array(
193 'name' => 'is_active',
194 'type' => CRM_Utils_Type
::T_BOOLEAN
,
195 'title' => ts('Is Active') ,
197 'table_name' => 'civicrm_msg_template',
198 'entity' => 'MessageTemplate',
199 'bao' => 'CRM_Core_BAO_MessageTemplate',
202 'workflow_id' => array(
203 'name' => 'workflow_id',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Message Template Workflow') ,
206 'description' => 'a pseudo-FK to civicrm_option_value',
207 'table_name' => 'civicrm_msg_template',
208 'entity' => 'MessageTemplate',
209 'bao' => 'CRM_Core_BAO_MessageTemplate',
212 'is_default' => array(
213 'name' => 'is_default',
214 'type' => CRM_Utils_Type
::T_BOOLEAN
,
215 'title' => ts('Message Template Is Default?') ,
216 'description' => 'is this the default message template for the workflow referenced by workflow_id?',
218 'table_name' => 'civicrm_msg_template',
219 'entity' => 'MessageTemplate',
220 'bao' => 'CRM_Core_BAO_MessageTemplate',
223 'is_reserved' => array(
224 'name' => 'is_reserved',
225 'type' => CRM_Utils_Type
::T_BOOLEAN
,
226 'title' => ts('Message Template Is Reserved?') ,
227 'description' => 'is this the reserved message template which we ship for the workflow referenced by workflow_id?',
228 'table_name' => 'civicrm_msg_template',
229 'entity' => 'MessageTemplate',
230 'bao' => 'CRM_Core_BAO_MessageTemplate',
235 'type' => CRM_Utils_Type
::T_BOOLEAN
,
236 'title' => ts('Message Template is used for SMS?') ,
237 'description' => 'Is this message template used for sms?',
238 'table_name' => 'civicrm_msg_template',
239 'entity' => 'MessageTemplate',
240 'bao' => 'CRM_Core_BAO_MessageTemplate',
243 'pdf_format_id' => array(
244 'name' => 'pdf_format_id',
245 'type' => CRM_Utils_Type
::T_INT
,
246 'title' => ts('Message Template Format') ,
247 'description' => 'a pseudo-FK to civicrm_option_value containing PDF Page Format.',
248 'table_name' => 'civicrm_msg_template',
249 'entity' => 'MessageTemplate',
250 'bao' => 'CRM_Core_BAO_MessageTemplate',
252 'pseudoconstant' => array(
253 'optionGroupName' => 'pdf_format',
255 'optionEditPath' => 'civicrm/admin/options/pdf_format',
259 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
261 return Civi
::$statics[__CLASS__
]['fields'];
264 * Return a mapping from field-name to the corresponding key (as used in fields()).
267 * Array(string $name => string $uniqueName).
269 static function &fieldKeys() {
270 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
271 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
273 return Civi
::$statics[__CLASS__
]['fieldKeys'];
276 * Returns the names of this table
280 static function getTableName() {
281 return self
::$_tableName;
284 * Returns if this table needs to be logged
292 * Returns the list of fields that can be imported
294 * @param bool $prefix
298 static function &import($prefix = false) {
299 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'msg_template', $prefix, array());
303 * Returns the list of fields that can be exported
305 * @param bool $prefix
309 static function &export($prefix = false) {
310 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'msg_template', $prefix, array());
314 * Returns the list of indices
316 public static function indices($localize = TRUE) {
318 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;