Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
0f03f337 | 6 | | Copyright CiviCRM LLC (c) 2004-2017 | |
e501603b TO |
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 | |
0f03f337 | 29 | * @copyright CiviCRM LLC (c) 2004-2017 |
e501603b TO |
30 | * |
31 | * Generated from xml/schema/CRM/Mailing/Component.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:6ba335406e14e0ac4cd865e7f1d7178b) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Mailing_DAO_Component extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_mailing_component'; | |
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 | * | |
53 | * @var int unsigned | |
54 | */ | |
55 | public $id; | |
56 | /** | |
57 | * The name of this component | |
58 | * | |
59 | * @var string | |
60 | */ | |
61 | public $name; | |
62 | /** | |
63 | * Type of Component. | |
64 | * | |
65 | * @var string | |
66 | */ | |
67 | public $component_type; | |
68 | /** | |
69 | * | |
70 | * @var string | |
71 | */ | |
72 | public $subject; | |
73 | /** | |
74 | * Body of the component in html format. | |
75 | * | |
76 | * @var text | |
77 | */ | |
78 | public $body_html; | |
79 | /** | |
80 | * Body of the component in text format. | |
81 | * | |
82 | * @var text | |
83 | */ | |
84 | public $body_text; | |
85 | /** | |
86 | * Is this the default component for this component_type? | |
87 | * | |
88 | * @var boolean | |
89 | */ | |
90 | public $is_default; | |
91 | /** | |
92 | * Is this property active? | |
93 | * | |
94 | * @var boolean | |
95 | */ | |
96 | public $is_active; | |
97 | /** | |
98 | * class constructor | |
99 | * | |
100 | * @return civicrm_mailing_component | |
101 | */ | |
102 | function __construct() { | |
103 | $this->__table = 'civicrm_mailing_component'; | |
104 | parent::__construct(); | |
105 | } | |
106 | /** | |
107 | * Returns all the column names of this table | |
108 | * | |
109 | * @return array | |
110 | */ | |
111 | static function &fields() { | |
346aaaba TO |
112 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
113 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
114 | 'id' => array( |
115 | 'name' => 'id', | |
116 | 'type' => CRM_Utils_Type::T_INT, | |
117 | 'title' => ts('Mailing Component ID') , | |
118 | 'required' => true, | |
119 | ) , | |
120 | 'name' => array( | |
121 | 'name' => 'name', | |
122 | 'type' => CRM_Utils_Type::T_STRING, | |
123 | 'title' => ts('Component Name') , | |
124 | 'description' => 'The name of this component', | |
125 | 'maxlength' => 64, | |
126 | 'size' => CRM_Utils_Type::BIG, | |
127 | ) , | |
128 | 'component_type' => array( | |
129 | 'name' => 'component_type', | |
130 | 'type' => CRM_Utils_Type::T_STRING, | |
131 | 'title' => ts('Mailing Component Type') , | |
132 | 'description' => 'Type of Component.', | |
133 | 'maxlength' => 12, | |
134 | 'size' => CRM_Utils_Type::TWELVE, | |
135 | 'html' => array( | |
136 | 'type' => 'Select', | |
137 | ) , | |
138 | 'pseudoconstant' => array( | |
139 | 'callback' => 'CRM_Core_SelectValues::mailingComponents', | |
140 | ) | |
141 | ) , | |
142 | 'subject' => array( | |
143 | 'name' => 'subject', | |
144 | 'type' => CRM_Utils_Type::T_STRING, | |
145 | 'title' => ts('Subject') , | |
146 | 'maxlength' => 255, | |
147 | 'size' => CRM_Utils_Type::HUGE, | |
148 | ) , | |
149 | 'body_html' => array( | |
150 | 'name' => 'body_html', | |
151 | 'type' => CRM_Utils_Type::T_TEXT, | |
152 | 'title' => ts('Mailing Component Body HTML') , | |
153 | 'description' => 'Body of the component in html format.', | |
154 | 'rows' => 8, | |
155 | 'cols' => 80, | |
156 | 'html' => array( | |
157 | 'type' => 'TextArea', | |
158 | ) , | |
159 | ) , | |
160 | 'body_text' => array( | |
161 | 'name' => 'body_text', | |
162 | 'type' => CRM_Utils_Type::T_TEXT, | |
163 | 'title' => ts('Body Text') , | |
164 | 'description' => 'Body of the component in text format.', | |
165 | 'rows' => 8, | |
166 | 'cols' => 80, | |
167 | 'html' => array( | |
168 | 'type' => 'TextArea', | |
169 | ) , | |
170 | ) , | |
171 | 'is_default' => array( | |
172 | 'name' => 'is_default', | |
173 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
174 | 'title' => ts('Mailing Component is Default?') , | |
175 | 'description' => 'Is this the default component for this component_type?', | |
176 | ) , | |
177 | 'is_active' => array( | |
178 | 'name' => 'is_active', | |
179 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
180 | 'title' => ts('Mailing Component Is Active?') , | |
181 | 'description' => 'Is this property active?', | |
182 | ) , | |
183 | ); | |
346aaaba | 184 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 185 | } |
346aaaba | 186 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
187 | } |
188 | /** | |
bd8e0b14 | 189 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
190 | * |
191 | * @return array | |
bd8e0b14 | 192 | * Array(string $name => string $uniqueName). |
e501603b TO |
193 | */ |
194 | static function &fieldKeys() { | |
bd8e0b14 TO |
195 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
196 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 197 | } |
bd8e0b14 | 198 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
199 | } |
200 | /** | |
201 | * Returns the names of this table | |
202 | * | |
203 | * @return string | |
204 | */ | |
205 | static function getTableName() { | |
206 | return self::$_tableName; | |
207 | } | |
208 | /** | |
209 | * Returns if this table needs to be logged | |
210 | * | |
211 | * @return boolean | |
212 | */ | |
213 | function getLog() { | |
214 | return self::$_log; | |
215 | } | |
216 | /** | |
217 | * Returns the list of fields that can be imported | |
218 | * | |
219 | * @param bool $prefix | |
220 | * | |
221 | * @return array | |
222 | */ | |
223 | static function &import($prefix = false) { | |
60808919 TO |
224 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_component', $prefix, array()); |
225 | return $r; | |
e501603b TO |
226 | } |
227 | /** | |
228 | * Returns the list of fields that can be exported | |
229 | * | |
230 | * @param bool $prefix | |
231 | * | |
232 | * @return array | |
233 | */ | |
234 | static function &export($prefix = false) { | |
60808919 TO |
235 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_component', $prefix, array()); |
236 | return $r; | |
e501603b TO |
237 | } |
238 | } |