Merge pull request #8944 from totten/master-givi
[civicrm-core.git] / CRM / Core / DAO / MessageTemplate.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
6| Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
30 *
31 * Generated from xml/schema/CRM/Core/MessageTemplate.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:3fbfb8f01af4d15128b6e3982d9337d9)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Core_DAO_MessageTemplate extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_msg_template';
e501603b
TO
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = false;
51 /**
52 * Message Template ID
53 *
54 * @var int unsigned
55 */
56 public $id;
57 /**
58 * Descriptive title of message
59 *
60 * @var string
61 */
62 public $msg_title;
63 /**
64 * Subject for email message.
65 *
66 * @var text
67 */
68 public $msg_subject;
69 /**
70 * Text formatted message
71 *
72 * @var longtext
73 */
74 public $msg_text;
75 /**
76 * HTML formatted message
77 *
78 * @var longtext
79 */
80 public $msg_html;
81 /**
82 *
83 * @var boolean
84 */
85 public $is_active;
86 /**
87 * a pseudo-FK to civicrm_option_value
88 *
89 * @var int unsigned
90 */
91 public $workflow_id;
92 /**
93 * is this the default message template for the workflow referenced by workflow_id?
94 *
95 * @var boolean
96 */
97 public $is_default;
98 /**
99 * is this the reserved message template which we ship for the workflow referenced by workflow_id?
100 *
101 * @var boolean
102 */
103 public $is_reserved;
104 /**
105 * Is this message template used for sms?
106 *
107 * @var boolean
108 */
109 public $is_sms;
110 /**
111 * a pseudo-FK to civicrm_option_value containing PDF Page Format.
112 *
113 * @var int unsigned
114 */
115 public $pdf_format_id;
116 /**
117 * class constructor
118 *
119 * @return civicrm_msg_template
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() {
346aaaba
TO
131 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
132 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
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 );
346aaaba 215 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 216 }
346aaaba 217 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
218 }
219 /**
bd8e0b14 220 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
221 *
222 * @return array
bd8e0b14 223 * Array(string $name => string $uniqueName).
e501603b
TO
224 */
225 static function &fieldKeys() {
bd8e0b14
TO
226 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
227 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 228 }
bd8e0b14 229 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
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) {
60808919
TO
255 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'msg_template', $prefix, array());
256 return $r;
e501603b
TO
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) {
60808919
TO
266 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'msg_template', $prefix, array());
267 return $r;
e501603b
TO
268 }
269}