Merge pull request #8916 from cividesk/CRM-19256-4.7
[civicrm-core.git] / CRM / Core / DAO / MessageTemplate.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2017
30 *
31 * Generated from xml/schema/CRM/Core/MessageTemplate.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:3fbfb8f01af4d15128b6e3982d9337d9)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Core_DAO_MessageTemplate constructor.
39 */
40 class CRM_Core_DAO_MessageTemplate extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_msg_template';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 * Message Template ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Descriptive title of message
61 *
62 * @var string
63 */
64 public $msg_title;
65 /**
66 * Subject for email message.
67 *
68 * @var text
69 */
70 public $msg_subject;
71 /**
72 * Text formatted message
73 *
74 * @var longtext
75 */
76 public $msg_text;
77 /**
78 * HTML formatted message
79 *
80 * @var longtext
81 */
82 public $msg_html;
83 /**
84 *
85 * @var boolean
86 */
87 public $is_active;
88 /**
89 * a pseudo-FK to civicrm_option_value
90 *
91 * @var int unsigned
92 */
93 public $workflow_id;
94 /**
95 * is this the default message template for the workflow referenced by workflow_id?
96 *
97 * @var boolean
98 */
99 public $is_default;
100 /**
101 * is this the reserved message template which we ship for the workflow referenced by workflow_id?
102 *
103 * @var boolean
104 */
105 public $is_reserved;
106 /**
107 * Is this message template used for sms?
108 *
109 * @var boolean
110 */
111 public $is_sms;
112 /**
113 * a pseudo-FK to civicrm_option_value containing PDF Page Format.
114 *
115 * @var int unsigned
116 */
117 public $pdf_format_id;
118 /**
119 * Class constructor.
120 */
121 function __construct() {
122 $this->__table = 'civicrm_msg_template';
123 parent::__construct();
124 }
125 /**
126 * Returns all the column names of this table
127 *
128 * @return array
129 */
130 static function &fields() {
131 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
132 Civi::$statics[__CLASS__]['fields'] = array(
133 'id' => array(
134 'name' => 'id',
135 'type' => CRM_Utils_Type::T_INT,
136 'title' => ts('Message Template ID') ,
137 'description' => 'Message Template ID',
138 'required' => true,
139 ) ,
140 'msg_title' => array(
141 'name' => 'msg_title',
142 'type' => CRM_Utils_Type::T_STRING,
143 'title' => ts('Message Template Title') ,
144 'description' => 'Descriptive title of message',
145 'maxlength' => 255,
146 'size' => CRM_Utils_Type::HUGE,
147 ) ,
148 'msg_subject' => array(
149 'name' => 'msg_subject',
150 'type' => CRM_Utils_Type::T_TEXT,
151 'title' => ts('Message Template Subject') ,
152 'description' => 'Subject for email message.',
153 ) ,
154 'msg_text' => array(
155 'name' => 'msg_text',
156 'type' => CRM_Utils_Type::T_LONGTEXT,
157 'title' => ts('Message Template Text') ,
158 'description' => 'Text formatted message',
159 'html' => array(
160 'type' => 'TextArea',
161 ) ,
162 ) ,
163 'msg_html' => array(
164 'name' => 'msg_html',
165 'type' => CRM_Utils_Type::T_LONGTEXT,
166 'title' => ts('Message Template HTML') ,
167 'description' => 'HTML formatted message',
168 'html' => array(
169 'type' => 'RichTextEditor',
170 ) ,
171 ) ,
172 'is_active' => array(
173 'name' => 'is_active',
174 'type' => CRM_Utils_Type::T_BOOLEAN,
175 'title' => ts('Is Active') ,
176 'default' => '1',
177 ) ,
178 'workflow_id' => array(
179 'name' => 'workflow_id',
180 'type' => CRM_Utils_Type::T_INT,
181 'title' => ts('Message Template Workflow') ,
182 'description' => 'a pseudo-FK to civicrm_option_value',
183 ) ,
184 'is_default' => array(
185 'name' => 'is_default',
186 'type' => CRM_Utils_Type::T_BOOLEAN,
187 'title' => ts('Message Template Is Default?') ,
188 'description' => 'is this the default message template for the workflow referenced by workflow_id?',
189 'default' => '1',
190 ) ,
191 'is_reserved' => array(
192 'name' => 'is_reserved',
193 'type' => CRM_Utils_Type::T_BOOLEAN,
194 'title' => ts('Message Template Is Reserved?') ,
195 'description' => 'is this the reserved message template which we ship for the workflow referenced by workflow_id?',
196 ) ,
197 'is_sms' => array(
198 'name' => 'is_sms',
199 'type' => CRM_Utils_Type::T_BOOLEAN,
200 'title' => ts('Message Template is used for SMS?') ,
201 'description' => 'Is this message template used for sms?',
202 ) ,
203 'pdf_format_id' => array(
204 'name' => 'pdf_format_id',
205 'type' => CRM_Utils_Type::T_INT,
206 'title' => ts('Message Template Format') ,
207 'description' => 'a pseudo-FK to civicrm_option_value containing PDF Page Format.',
208 'pseudoconstant' => array(
209 'optionGroupName' => 'pdf_format',
210 'keyColumn' => 'id',
211 'optionEditPath' => 'civicrm/admin/options/pdf_format',
212 )
213 ) ,
214 );
215 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
216 }
217 return Civi::$statics[__CLASS__]['fields'];
218 }
219 /**
220 * Return a mapping from field-name to the corresponding key (as used in fields()).
221 *
222 * @return array
223 * Array(string $name => string $uniqueName).
224 */
225 static function &fieldKeys() {
226 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
227 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
228 }
229 return Civi::$statics[__CLASS__]['fieldKeys'];
230 }
231 /**
232 * Returns the names of this table
233 *
234 * @return string
235 */
236 static function getTableName() {
237 return self::$_tableName;
238 }
239 /**
240 * Returns if this table needs to be logged
241 *
242 * @return boolean
243 */
244 function getLog() {
245 return self::$_log;
246 }
247 /**
248 * Returns the list of fields that can be imported
249 *
250 * @param bool $prefix
251 *
252 * @return array
253 */
254 static function &import($prefix = false) {
255 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'msg_template', $prefix, array());
256 return $r;
257 }
258 /**
259 * Returns the list of fields that can be exported
260 *
261 * @param bool $prefix
262 *
263 * @return array
264 */
265 static function &export($prefix = false) {
266 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'msg_template', $prefix, array());
267 return $r;
268 }
269 }