Translate description in DAO files
[civicrm-core.git] / CRM / PCP / DAO / PCPBlock.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
8c9251b3 5 * @copyright CiviCRM LLC (c) 2004-2018
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/PCP/PCPBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
6a7e5e5d 9 * (GenCodeChecksum:5e7c52122eb7d5b428bb717c7c634327)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the PCPBlock entity.
f41f0342 14 */
e501603b 15class CRM_PCP_DAO_PCPBlock extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_pcp_block';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
c3fc2621
CW
29 static $_log = TRUE;
30
e501603b
TO
31 /**
32 * PCP block Id
33 *
34 * @var int unsigned
35 */
36 public $id;
c3fc2621 37
e501603b 38 /**
e501603b
TO
39 * @var string
40 */
41 public $entity_table;
c3fc2621 42
e501603b
TO
43 /**
44 * FK to civicrm_contribution_page.id OR civicrm_event.id
45 *
46 * @var int unsigned
47 */
48 public $entity_id;
c3fc2621 49
e501603b
TO
50 /**
51 * The type of entity that this pcp targets
52 *
53 * @var string
54 */
55 public $target_entity_type;
c3fc2621 56
e501603b
TO
57 /**
58 * The entity that this pcp targets
59 *
60 * @var int unsigned
61 */
62 public $target_entity_id;
c3fc2621 63
e501603b
TO
64 /**
65 * FK to civicrm_uf_group.id. Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?
66 *
67 * @var int unsigned
68 */
69 public $supporter_profile_id;
c3fc2621 70
e501603b
TO
71 /**
72 * FK to civicrm_option_group with name = PCP owner notifications
73 *
74 * @var int unsigned
75 */
76 public $owner_notify_id;
c3fc2621 77
e501603b
TO
78 /**
79 * Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?
80 *
81 * @var boolean
82 */
83 public $is_approval_needed;
c3fc2621 84
e501603b
TO
85 /**
86 * Does Personal Campaign Page allow using tell a friend?
87 *
88 * @var boolean
89 */
90 public $is_tellfriend_enabled;
c3fc2621 91
e501603b
TO
92 /**
93 * Maximum recipient fields allowed in tell a friend
94 *
95 * @var int unsigned
96 */
97 public $tellfriend_limit;
c3fc2621 98
e501603b
TO
99 /**
100 * Link text for PCP.
101 *
102 * @var string
103 */
104 public $link_text;
c3fc2621 105
e501603b
TO
106 /**
107 * Is Personal Campaign Page Block enabled/active?
108 *
109 * @var boolean
110 */
111 public $is_active;
c3fc2621 112
e501603b
TO
113 /**
114 * If set, notification is automatically emailed to this email-address on create/update Personal Campaign Page
115 *
116 * @var string
117 */
118 public $notify_email;
c3fc2621 119
e501603b 120 /**
f41f0342 121 * Class constructor.
e501603b 122 */
c3fc2621 123 public function __construct() {
e501603b
TO
124 $this->__table = 'civicrm_pcp_block';
125 parent::__construct();
126 }
c3fc2621 127
e501603b 128 /**
f41f0342 129 * Returns foreign keys and entity references.
e501603b
TO
130 *
131 * @return array
132 * [CRM_Core_Reference_Interface]
133 */
c3fc2621 134 public static function getReferenceColumns() {
346aaaba
TO
135 if (!isset(Civi::$statics[__CLASS__]['links'])) {
136 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
c3fc2621
CW
137 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'supporter_profile_id', 'civicrm_uf_group', 'id');
138 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
139 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName(), 'target_entity_id', NULL, 'id', 'target_entity_type');
346aaaba 140 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 141 }
346aaaba 142 return Civi::$statics[__CLASS__]['links'];
e501603b 143 }
c3fc2621 144
e501603b
TO
145 /**
146 * Returns all the column names of this table
147 *
148 * @return array
149 */
c3fc2621 150 public static function &fields() {
346aaaba 151 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
152 Civi::$statics[__CLASS__]['fields'] = [
153 'id' => [
e501603b
TO
154 'name' => 'id',
155 'type' => CRM_Utils_Type::T_INT,
c3fc2621 156 'title' => ts('PCP Block ID'),
215b423e 157 'description' => ts('PCP block Id'),
c3fc2621 158 'required' => TRUE,
522a26c9 159 'table_name' => 'civicrm_pcp_block',
160 'entity' => 'PCPBlock',
161 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 162 'localizable' => 0,
c3fc2621
CW
163 ],
164 'entity_table' => [
e501603b
TO
165 'name' => 'entity_table',
166 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 167 'title' => ts('Entity Table'),
e501603b
TO
168 'maxlength' => 64,
169 'size' => CRM_Utils_Type::BIG,
522a26c9 170 'table_name' => 'civicrm_pcp_block',
171 'entity' => 'PCPBlock',
172 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 173 'localizable' => 0,
c3fc2621
CW
174 ],
175 'entity_id' => [
e501603b
TO
176 'name' => 'entity_id',
177 'type' => CRM_Utils_Type::T_INT,
c3fc2621 178 'title' => ts('Entity'),
215b423e 179 'description' => ts('FK to civicrm_contribution_page.id OR civicrm_event.id'),
c3fc2621 180 'required' => TRUE,
522a26c9 181 'table_name' => 'civicrm_pcp_block',
182 'entity' => 'PCPBlock',
183 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 184 'localizable' => 0,
c3fc2621
CW
185 ],
186 'target_entity_type' => [
e501603b
TO
187 'name' => 'target_entity_type',
188 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 189 'title' => ts('Target Entity'),
215b423e 190 'description' => ts('The type of entity that this pcp targets'),
c3fc2621 191 'required' => TRUE,
e501603b
TO
192 'maxlength' => 255,
193 'size' => CRM_Utils_Type::HUGE,
194 'default' => 'contribute',
522a26c9 195 'table_name' => 'civicrm_pcp_block',
196 'entity' => 'PCPBlock',
197 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 198 'localizable' => 0,
c3fc2621
CW
199 ],
200 'target_entity_id' => [
e501603b
TO
201 'name' => 'target_entity_id',
202 'type' => CRM_Utils_Type::T_INT,
c3fc2621 203 'title' => ts('Target Entity ID'),
215b423e 204 'description' => ts('The entity that this pcp targets'),
c3fc2621 205 'required' => TRUE,
522a26c9 206 'table_name' => 'civicrm_pcp_block',
207 'entity' => 'PCPBlock',
208 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 209 'localizable' => 0,
c3fc2621
CW
210 ],
211 'supporter_profile_id' => [
e501603b
TO
212 'name' => 'supporter_profile_id',
213 'type' => CRM_Utils_Type::T_INT,
c3fc2621 214 'title' => ts('Supporter Profile'),
215b423e 215 'description' => ts('FK to civicrm_uf_group.id. Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?'),
e501603b 216 'default' => 'NULL',
522a26c9 217 'table_name' => 'civicrm_pcp_block',
218 'entity' => 'PCPBlock',
219 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 220 'localizable' => 0,
e501603b 221 'FKClassName' => 'CRM_Core_DAO_UFGroup',
c3fc2621
CW
222 ],
223 'owner_notify_id' => [
e501603b
TO
224 'name' => 'owner_notify_id',
225 'type' => CRM_Utils_Type::T_INT,
c3fc2621 226 'title' => ts('Owner Notification'),
215b423e 227 'description' => ts('FK to civicrm_option_group with name = PCP owner notifications'),
45a83e42 228 'default' => '0',
522a26c9 229 'table_name' => 'civicrm_pcp_block',
230 'entity' => 'PCPBlock',
231 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 232 'localizable' => 0,
c3fc2621 233 'html' => [
e501603b 234 'type' => 'Radio',
c3fc2621
CW
235 ],
236 'pseudoconstant' => [
e501603b
TO
237 'optionGroupName' => 'pcp_owner_notify',
238 'optionEditPath' => 'civicrm/admin/options/pcp_owner_notify',
c3fc2621
CW
239 ]
240 ],
241 'is_approval_needed' => [
e501603b
TO
242 'name' => 'is_approval_needed',
243 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 244 'title' => ts('Approval Required?'),
215b423e 245 'description' => ts('Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?'),
e501603b 246 'default' => 'NULL',
522a26c9 247 'table_name' => 'civicrm_pcp_block',
248 'entity' => 'PCPBlock',
249 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 250 'localizable' => 0,
c3fc2621
CW
251 ],
252 'is_tellfriend_enabled' => [
e501603b
TO
253 'name' => 'is_tellfriend_enabled',
254 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 255 'title' => ts('Tell a Friend Enabled?'),
215b423e 256 'description' => ts('Does Personal Campaign Page allow using tell a friend?'),
e501603b 257 'default' => 'NULL',
522a26c9 258 'table_name' => 'civicrm_pcp_block',
259 'entity' => 'PCPBlock',
260 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 261 'localizable' => 0,
c3fc2621
CW
262 ],
263 'tellfriend_limit' => [
e501603b
TO
264 'name' => 'tellfriend_limit',
265 'type' => CRM_Utils_Type::T_INT,
c3fc2621 266 'title' => ts('Tell A Friend Limit'),
215b423e 267 'description' => ts('Maximum recipient fields allowed in tell a friend'),
e501603b 268 'default' => 'NULL',
522a26c9 269 'table_name' => 'civicrm_pcp_block',
270 'entity' => 'PCPBlock',
271 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 272 'localizable' => 0,
c3fc2621
CW
273 ],
274 'link_text' => [
e501603b
TO
275 'name' => 'link_text',
276 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 277 'title' => ts('Link Text'),
215b423e 278 'description' => ts('Link text for PCP.'),
e501603b
TO
279 'maxlength' => 255,
280 'size' => CRM_Utils_Type::HUGE,
281 'default' => 'NULL',
522a26c9 282 'table_name' => 'civicrm_pcp_block',
283 'entity' => 'PCPBlock',
284 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 285 'localizable' => 1,
c3fc2621
CW
286 ],
287 'is_active' => [
e501603b
TO
288 'name' => 'is_active',
289 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 290 'title' => ts('Enabled?'),
215b423e 291 'description' => ts('Is Personal Campaign Page Block enabled/active?'),
e501603b 292 'default' => '1',
522a26c9 293 'table_name' => 'civicrm_pcp_block',
294 'entity' => 'PCPBlock',
295 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 296 'localizable' => 0,
c3fc2621
CW
297 ],
298 'notify_email' => [
e501603b
TO
299 'name' => 'notify_email',
300 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 301 'title' => ts('Notification Email'),
215b423e 302 'description' => ts('If set, notification is automatically emailed to this email-address on create/update Personal Campaign Page'),
e501603b
TO
303 'maxlength' => 255,
304 'size' => CRM_Utils_Type::HUGE,
305 'default' => 'NULL',
522a26c9 306 'table_name' => 'civicrm_pcp_block',
307 'entity' => 'PCPBlock',
308 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 309 'localizable' => 0,
c3fc2621
CW
310 ],
311 ];
346aaaba 312 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 313 }
346aaaba 314 return Civi::$statics[__CLASS__]['fields'];
e501603b 315 }
c3fc2621 316
e501603b 317 /**
bd8e0b14 318 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
319 *
320 * @return array
bd8e0b14 321 * Array(string $name => string $uniqueName).
e501603b 322 */
c3fc2621 323 public static function &fieldKeys() {
bd8e0b14
TO
324 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
325 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 326 }
bd8e0b14 327 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 328 }
c3fc2621 329
e501603b
TO
330 /**
331 * Returns the names of this table
332 *
333 * @return string
334 */
c3fc2621 335 public static function getTableName() {
e501603b
TO
336 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
337 }
c3fc2621 338
e501603b
TO
339 /**
340 * Returns if this table needs to be logged
341 *
c3fc2621 342 * @return bool
e501603b 343 */
c3fc2621 344 public function getLog() {
e501603b
TO
345 return self::$_log;
346 }
c3fc2621 347
e501603b
TO
348 /**
349 * Returns the list of fields that can be imported
350 *
351 * @param bool $prefix
352 *
353 * @return array
354 */
c3fc2621
CW
355 public static function &import($prefix = FALSE) {
356 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'pcp_block', $prefix, []);
60808919 357 return $r;
e501603b 358 }
c3fc2621 359
e501603b
TO
360 /**
361 * Returns the list of fields that can be exported
362 *
363 * @param bool $prefix
364 *
365 * @return array
366 */
c3fc2621
CW
367 public static function &export($prefix = FALSE) {
368 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'pcp_block', $prefix, []);
60808919 369 return $r;
e501603b 370 }
c3fc2621 371
e7a6b91a
AS
372 /**
373 * Returns the list of indices
c3fc2621
CW
374 *
375 * @param bool $localize
376 *
377 * @return array
e7a6b91a
AS
378 */
379 public static function indices($localize = TRUE) {
c3fc2621 380 $indices = [];
e7a6b91a
AS
381 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
382 }
c3fc2621 383
e501603b 384}