Move help section outside the container
[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'),
e501603b 157 'description' => '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'),
e501603b 179 'description' => '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'),
e501603b 190 'description' => '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'),
e501603b 204 'description' => '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'),
e501603b
TO
215 'description' => 'FK to civicrm_uf_group.id. Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?',
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'),
e501603b 227 'description' => 'FK to civicrm_option_group with name = PCP owner notifications',
522a26c9 228 'table_name' => 'civicrm_pcp_block',
229 'entity' => 'PCPBlock',
230 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 231 'localizable' => 0,
c3fc2621 232 'html' => [
e501603b 233 'type' => 'Radio',
c3fc2621
CW
234 ],
235 'pseudoconstant' => [
e501603b
TO
236 'optionGroupName' => 'pcp_owner_notify',
237 'optionEditPath' => 'civicrm/admin/options/pcp_owner_notify',
c3fc2621
CW
238 ]
239 ],
240 'is_approval_needed' => [
e501603b
TO
241 'name' => 'is_approval_needed',
242 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 243 'title' => ts('Approval Required?'),
e501603b
TO
244 'description' => 'Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?',
245 'default' => 'NULL',
522a26c9 246 'table_name' => 'civicrm_pcp_block',
247 'entity' => 'PCPBlock',
248 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 249 'localizable' => 0,
c3fc2621
CW
250 ],
251 'is_tellfriend_enabled' => [
e501603b
TO
252 'name' => 'is_tellfriend_enabled',
253 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 254 'title' => ts('Tell a Friend Enabled?'),
e501603b
TO
255 'description' => 'Does Personal Campaign Page allow using tell a friend?',
256 'default' => 'NULL',
522a26c9 257 'table_name' => 'civicrm_pcp_block',
258 'entity' => 'PCPBlock',
259 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 260 'localizable' => 0,
c3fc2621
CW
261 ],
262 'tellfriend_limit' => [
e501603b
TO
263 'name' => 'tellfriend_limit',
264 'type' => CRM_Utils_Type::T_INT,
c3fc2621 265 'title' => ts('Tell A Friend Limit'),
e501603b
TO
266 'description' => 'Maximum recipient fields allowed in tell a friend',
267 'default' => 'NULL',
522a26c9 268 'table_name' => 'civicrm_pcp_block',
269 'entity' => 'PCPBlock',
270 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 271 'localizable' => 0,
c3fc2621
CW
272 ],
273 'link_text' => [
e501603b
TO
274 'name' => 'link_text',
275 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 276 'title' => ts('Link Text'),
e501603b
TO
277 'description' => 'Link text for PCP.',
278 'maxlength' => 255,
279 'size' => CRM_Utils_Type::HUGE,
280 'default' => 'NULL',
522a26c9 281 'table_name' => 'civicrm_pcp_block',
282 'entity' => 'PCPBlock',
283 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 284 'localizable' => 1,
c3fc2621
CW
285 ],
286 'is_active' => [
e501603b
TO
287 'name' => 'is_active',
288 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 289 'title' => ts('Enabled?'),
e501603b
TO
290 'description' => 'Is Personal Campaign Page Block enabled/active?',
291 'default' => '1',
522a26c9 292 'table_name' => 'civicrm_pcp_block',
293 'entity' => 'PCPBlock',
294 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 295 'localizable' => 0,
c3fc2621
CW
296 ],
297 'notify_email' => [
e501603b
TO
298 'name' => 'notify_email',
299 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 300 'title' => ts('Notification Email'),
e501603b
TO
301 'description' => 'If set, notification is automatically emailed to this email-address on create/update Personal Campaign Page',
302 'maxlength' => 255,
303 'size' => CRM_Utils_Type::HUGE,
304 'default' => 'NULL',
522a26c9 305 'table_name' => 'civicrm_pcp_block',
306 'entity' => 'PCPBlock',
307 'bao' => 'CRM_PCP_BAO_PCPBlock',
6a7e5e5d 308 'localizable' => 0,
c3fc2621
CW
309 ],
310 ];
346aaaba 311 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 312 }
346aaaba 313 return Civi::$statics[__CLASS__]['fields'];
e501603b 314 }
c3fc2621 315
e501603b 316 /**
bd8e0b14 317 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
318 *
319 * @return array
bd8e0b14 320 * Array(string $name => string $uniqueName).
e501603b 321 */
c3fc2621 322 public static function &fieldKeys() {
bd8e0b14
TO
323 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
324 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 325 }
bd8e0b14 326 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 327 }
c3fc2621 328
e501603b
TO
329 /**
330 * Returns the names of this table
331 *
332 * @return string
333 */
c3fc2621 334 public static function getTableName() {
e501603b
TO
335 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
336 }
c3fc2621 337
e501603b
TO
338 /**
339 * Returns if this table needs to be logged
340 *
c3fc2621 341 * @return bool
e501603b 342 */
c3fc2621 343 public function getLog() {
e501603b
TO
344 return self::$_log;
345 }
c3fc2621 346
e501603b
TO
347 /**
348 * Returns the list of fields that can be imported
349 *
350 * @param bool $prefix
351 *
352 * @return array
353 */
c3fc2621
CW
354 public static function &import($prefix = FALSE) {
355 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'pcp_block', $prefix, []);
60808919 356 return $r;
e501603b 357 }
c3fc2621 358
e501603b
TO
359 /**
360 * Returns the list of fields that can be exported
361 *
362 * @param bool $prefix
363 *
364 * @return array
365 */
c3fc2621
CW
366 public static function &export($prefix = FALSE) {
367 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'pcp_block', $prefix, []);
60808919 368 return $r;
e501603b 369 }
c3fc2621 370
e7a6b91a
AS
371 /**
372 * Returns the list of indices
c3fc2621
CW
373 *
374 * @param bool $localize
375 *
376 * @return array
e7a6b91a
AS
377 */
378 public static function indices($localize = TRUE) {
c3fc2621 379 $indices = [];
e7a6b91a
AS
380 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
381 }
c3fc2621 382
e501603b 383}