Translate description in DAO files
[civicrm-core.git] / CRM / Contribute / DAO / Widget.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2018
6 *
7 * Generated from xml/schema/CRM/Contribute/Widget.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b47ae223e6fd74db68394139a309be31)
10 */
11
12 /**
13 * Database access object for the Widget entity.
14 */
15 class CRM_Contribute_DAO_Widget extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_contribution_widget';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 static $_log = TRUE;
30
31 /**
32 * Contribution Id
33 *
34 * @var int unsigned
35 */
36 public $id;
37
38 /**
39 * The Contribution Page which triggered this contribution
40 *
41 * @var int unsigned
42 */
43 public $contribution_page_id;
44
45 /**
46 * Is this property active?
47 *
48 * @var boolean
49 */
50 public $is_active;
51
52 /**
53 * Widget title.
54 *
55 * @var string
56 */
57 public $title;
58
59 /**
60 * URL to Widget logo
61 *
62 * @var string
63 */
64 public $url_logo;
65
66 /**
67 * Button title.
68 *
69 * @var string
70 */
71 public $button_title;
72
73 /**
74 * About description.
75 *
76 * @var text
77 */
78 public $about;
79
80 /**
81 * URL to Homepage.
82 *
83 * @var string
84 */
85 public $url_homepage;
86
87 /**
88 * @var string
89 */
90 public $color_title;
91
92 /**
93 * @var string
94 */
95 public $color_button;
96
97 /**
98 * @var string
99 */
100 public $color_bar;
101
102 /**
103 * @var string
104 */
105 public $color_main_text;
106
107 /**
108 * @var string
109 */
110 public $color_main;
111
112 /**
113 * @var string
114 */
115 public $color_main_bg;
116
117 /**
118 * @var string
119 */
120 public $color_bg;
121
122 /**
123 * @var string
124 */
125 public $color_about_link;
126
127 /**
128 * @var string
129 */
130 public $color_homepage_link;
131
132 /**
133 * Class constructor.
134 */
135 public function __construct() {
136 $this->__table = 'civicrm_contribution_widget';
137 parent::__construct();
138 }
139
140 /**
141 * Returns foreign keys and entity references.
142 *
143 * @return array
144 * [CRM_Core_Reference_Interface]
145 */
146 public static function getReferenceColumns() {
147 if (!isset(Civi::$statics[__CLASS__]['links'])) {
148 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
149 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contribution_page_id', 'civicrm_contribution_page', 'id');
150 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
151 }
152 return Civi::$statics[__CLASS__]['links'];
153 }
154
155 /**
156 * Returns all the column names of this table
157 *
158 * @return array
159 */
160 public static function &fields() {
161 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
162 Civi::$statics[__CLASS__]['fields'] = [
163 'id' => [
164 'name' => 'id',
165 'type' => CRM_Utils_Type::T_INT,
166 'title' => ts('Widget ID'),
167 'description' => ts('Contribution Id'),
168 'required' => TRUE,
169 'table_name' => 'civicrm_contribution_widget',
170 'entity' => 'Widget',
171 'bao' => 'CRM_Contribute_BAO_Widget',
172 'localizable' => 0,
173 ],
174 'contribution_page_id' => [
175 'name' => 'contribution_page_id',
176 'type' => CRM_Utils_Type::T_INT,
177 'title' => ts('Contribution Page'),
178 'description' => ts('The Contribution Page which triggered this contribution'),
179 'table_name' => 'civicrm_contribution_widget',
180 'entity' => 'Widget',
181 'bao' => 'CRM_Contribute_BAO_Widget',
182 'localizable' => 0,
183 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
184 ],
185 'is_active' => [
186 'name' => 'is_active',
187 'type' => CRM_Utils_Type::T_BOOLEAN,
188 'title' => ts('Enabled?'),
189 'description' => ts('Is this property active?'),
190 'table_name' => 'civicrm_contribution_widget',
191 'entity' => 'Widget',
192 'bao' => 'CRM_Contribute_BAO_Widget',
193 'localizable' => 0,
194 ],
195 'title' => [
196 'name' => 'title',
197 'type' => CRM_Utils_Type::T_STRING,
198 'title' => ts('Widget Title'),
199 'description' => ts('Widget title.'),
200 'maxlength' => 255,
201 'size' => CRM_Utils_Type::HUGE,
202 'table_name' => 'civicrm_contribution_widget',
203 'entity' => 'Widget',
204 'bao' => 'CRM_Contribute_BAO_Widget',
205 'localizable' => 0,
206 ],
207 'url_logo' => [
208 'name' => 'url_logo',
209 'type' => CRM_Utils_Type::T_STRING,
210 'title' => ts('Widget Image Url'),
211 'description' => ts('URL to Widget logo'),
212 'maxlength' => 255,
213 'size' => CRM_Utils_Type::HUGE,
214 'table_name' => 'civicrm_contribution_widget',
215 'entity' => 'Widget',
216 'bao' => 'CRM_Contribute_BAO_Widget',
217 'localizable' => 0,
218 ],
219 'button_title' => [
220 'name' => 'button_title',
221 'type' => CRM_Utils_Type::T_STRING,
222 'title' => ts('Button Title'),
223 'description' => ts('Button title.'),
224 'maxlength' => 255,
225 'size' => CRM_Utils_Type::HUGE,
226 'table_name' => 'civicrm_contribution_widget',
227 'entity' => 'Widget',
228 'bao' => 'CRM_Contribute_BAO_Widget',
229 'localizable' => 0,
230 ],
231 'about' => [
232 'name' => 'about',
233 'type' => CRM_Utils_Type::T_TEXT,
234 'title' => ts('Description'),
235 'description' => ts('About description.'),
236 'table_name' => 'civicrm_contribution_widget',
237 'entity' => 'Widget',
238 'bao' => 'CRM_Contribute_BAO_Widget',
239 'localizable' => 0,
240 ],
241 'url_homepage' => [
242 'name' => 'url_homepage',
243 'type' => CRM_Utils_Type::T_STRING,
244 'title' => ts('Homepage Url'),
245 'description' => ts('URL to Homepage.'),
246 'maxlength' => 255,
247 'size' => CRM_Utils_Type::HUGE,
248 'table_name' => 'civicrm_contribution_widget',
249 'entity' => 'Widget',
250 'bao' => 'CRM_Contribute_BAO_Widget',
251 'localizable' => 0,
252 ],
253 'color_title' => [
254 'name' => 'color_title',
255 'type' => CRM_Utils_Type::T_STRING,
256 'title' => ts('Title Color'),
257 'maxlength' => 10,
258 'size' => CRM_Utils_Type::TWELVE,
259 'table_name' => 'civicrm_contribution_widget',
260 'entity' => 'Widget',
261 'bao' => 'CRM_Contribute_BAO_Widget',
262 'localizable' => 0,
263 ],
264 'color_button' => [
265 'name' => 'color_button',
266 'type' => CRM_Utils_Type::T_STRING,
267 'title' => ts('Button Colour'),
268 'maxlength' => 10,
269 'size' => CRM_Utils_Type::TWELVE,
270 'table_name' => 'civicrm_contribution_widget',
271 'entity' => 'Widget',
272 'bao' => 'CRM_Contribute_BAO_Widget',
273 'localizable' => 0,
274 ],
275 'color_bar' => [
276 'name' => 'color_bar',
277 'type' => CRM_Utils_Type::T_STRING,
278 'title' => ts('Bar Color'),
279 'maxlength' => 10,
280 'size' => CRM_Utils_Type::TWELVE,
281 'table_name' => 'civicrm_contribution_widget',
282 'entity' => 'Widget',
283 'bao' => 'CRM_Contribute_BAO_Widget',
284 'localizable' => 0,
285 ],
286 'color_main_text' => [
287 'name' => 'color_main_text',
288 'type' => CRM_Utils_Type::T_STRING,
289 'title' => ts('Main Text Color'),
290 'maxlength' => 10,
291 'size' => CRM_Utils_Type::TWELVE,
292 'table_name' => 'civicrm_contribution_widget',
293 'entity' => 'Widget',
294 'bao' => 'CRM_Contribute_BAO_Widget',
295 'localizable' => 0,
296 ],
297 'color_main' => [
298 'name' => 'color_main',
299 'type' => CRM_Utils_Type::T_STRING,
300 'title' => ts('Main Colour'),
301 'maxlength' => 10,
302 'size' => CRM_Utils_Type::TWELVE,
303 'table_name' => 'civicrm_contribution_widget',
304 'entity' => 'Widget',
305 'bao' => 'CRM_Contribute_BAO_Widget',
306 'localizable' => 0,
307 ],
308 'color_main_bg' => [
309 'name' => 'color_main_bg',
310 'type' => CRM_Utils_Type::T_STRING,
311 'title' => ts('Backgroup Color'),
312 'maxlength' => 10,
313 'size' => CRM_Utils_Type::TWELVE,
314 'table_name' => 'civicrm_contribution_widget',
315 'entity' => 'Widget',
316 'bao' => 'CRM_Contribute_BAO_Widget',
317 'localizable' => 0,
318 ],
319 'color_bg' => [
320 'name' => 'color_bg',
321 'type' => CRM_Utils_Type::T_STRING,
322 'title' => ts('Other Backgroun Colour'),
323 'maxlength' => 10,
324 'size' => CRM_Utils_Type::TWELVE,
325 'table_name' => 'civicrm_contribution_widget',
326 'entity' => 'Widget',
327 'bao' => 'CRM_Contribute_BAO_Widget',
328 'localizable' => 0,
329 ],
330 'color_about_link' => [
331 'name' => 'color_about_link',
332 'type' => CRM_Utils_Type::T_STRING,
333 'title' => ts('About Link Colour'),
334 'maxlength' => 10,
335 'size' => CRM_Utils_Type::TWELVE,
336 'table_name' => 'civicrm_contribution_widget',
337 'entity' => 'Widget',
338 'bao' => 'CRM_Contribute_BAO_Widget',
339 'localizable' => 0,
340 ],
341 'color_homepage_link' => [
342 'name' => 'color_homepage_link',
343 'type' => CRM_Utils_Type::T_STRING,
344 'title' => ts('Homepage Link Colour'),
345 'maxlength' => 10,
346 'size' => CRM_Utils_Type::TWELVE,
347 'table_name' => 'civicrm_contribution_widget',
348 'entity' => 'Widget',
349 'bao' => 'CRM_Contribute_BAO_Widget',
350 'localizable' => 0,
351 ],
352 ];
353 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
354 }
355 return Civi::$statics[__CLASS__]['fields'];
356 }
357
358 /**
359 * Return a mapping from field-name to the corresponding key (as used in fields()).
360 *
361 * @return array
362 * Array(string $name => string $uniqueName).
363 */
364 public static function &fieldKeys() {
365 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
366 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
367 }
368 return Civi::$statics[__CLASS__]['fieldKeys'];
369 }
370
371 /**
372 * Returns the names of this table
373 *
374 * @return string
375 */
376 public static function getTableName() {
377 return self::$_tableName;
378 }
379
380 /**
381 * Returns if this table needs to be logged
382 *
383 * @return bool
384 */
385 public function getLog() {
386 return self::$_log;
387 }
388
389 /**
390 * Returns the list of fields that can be imported
391 *
392 * @param bool $prefix
393 *
394 * @return array
395 */
396 public static function &import($prefix = FALSE) {
397 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_widget', $prefix, []);
398 return $r;
399 }
400
401 /**
402 * Returns the list of fields that can be exported
403 *
404 * @param bool $prefix
405 *
406 * @return array
407 */
408 public static function &export($prefix = FALSE) {
409 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_widget', $prefix, []);
410 return $r;
411 }
412
413 /**
414 * Returns the list of indices
415 *
416 * @param bool $localize
417 *
418 * @return array
419 */
420 public static function indices($localize = TRUE) {
421 $indices = [];
422 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
423 }
424
425 }