5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/PCP/PCPBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:5528529230e5f5dbcfa0466ada0514d1)
13 * Database access object for the PCPBlock entity.
15 class CRM_PCP_DAO_PCPBlock
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.2';
18 const COMPONENT
= 'CiviContribute';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_pcp_block';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = TRUE;
37 * @var int|string|null
38 * (SQL type: int unsigned)
39 * Note that values will be retrieved from the database as a string.
45 * (SQL type: varchar(64))
46 * Note that values will be retrieved from the database as a string.
51 * FK to civicrm_contribution_page.id OR civicrm_event.id
54 * (SQL type: int unsigned)
55 * Note that values will be retrieved from the database as a string.
60 * The type of entity that this pcp targets
63 * (SQL type: varchar(255))
64 * Note that values will be retrieved from the database as a string.
66 public $target_entity_type;
69 * The entity that this pcp targets
72 * (SQL type: int unsigned)
73 * Note that values will be retrieved from the database as a string.
75 public $target_entity_id;
78 * FK to civicrm_uf_group.id. Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?
80 * @var int|string|null
81 * (SQL type: int unsigned)
82 * Note that values will be retrieved from the database as a string.
84 public $supporter_profile_id;
87 * FK to civicrm_option_group with name = PCP owner notifications
89 * @var int|string|null
90 * (SQL type: int unsigned)
91 * Note that values will be retrieved from the database as a string.
93 public $owner_notify_id;
96 * Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?
98 * @var bool|string|null
100 * Note that values will be retrieved from the database as a string.
102 public $is_approval_needed;
105 * Does Personal Campaign Page allow using tell a friend?
107 * @var bool|string|null
108 * (SQL type: tinyint)
109 * Note that values will be retrieved from the database as a string.
111 public $is_tellfriend_enabled;
114 * Maximum recipient fields allowed in tell a friend
116 * @var int|string|null
117 * (SQL type: int unsigned)
118 * Note that values will be retrieved from the database as a string.
120 public $tellfriend_limit;
126 * (SQL type: varchar(255))
127 * Note that values will be retrieved from the database as a string.
132 * Is Personal Campaign Page Block enabled/active?
134 * @var bool|string|null
135 * (SQL type: tinyint)
136 * Note that values will be retrieved from the database as a string.
141 * If set, notification is automatically emailed to this email-address on create/update Personal Campaign Page
144 * (SQL type: varchar(255))
145 * Note that values will be retrieved from the database as a string.
147 public $notify_email;
152 public function __construct() {
153 $this->__table
= 'civicrm_pcp_block';
154 parent
::__construct();
158 * Returns localized title of this entity.
160 * @param bool $plural
161 * Whether to return the plural version of the title.
163 public static function getEntityTitle($plural = FALSE) {
164 return $plural ?
ts('PCPBlocks') : ts('PCPBlock');
168 * Returns foreign keys and entity references.
171 * [CRM_Core_Reference_Interface]
173 public static function getReferenceColumns() {
174 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
175 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
176 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'supporter_profile_id', 'civicrm_uf_group', 'id');
177 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
178 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'target_entity_id', NULL, 'id', 'target_entity_type');
179 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
181 return Civi
::$statics[__CLASS__
]['links'];
185 * Returns all the column names of this table
189 public static function &fields() {
190 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
191 Civi
::$statics[__CLASS__
]['fields'] = [
194 'type' => CRM_Utils_Type
::T_INT
,
195 'title' => ts('PCP Block ID'),
196 'description' => ts('PCP block ID'),
198 'where' => 'civicrm_pcp_block.id',
199 'table_name' => 'civicrm_pcp_block',
200 'entity' => 'PCPBlock',
201 'bao' => 'CRM_PCP_BAO_PCPBlock',
210 'name' => 'entity_table',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('Entity Table'),
214 'size' => CRM_Utils_Type
::BIG
,
215 'where' => 'civicrm_pcp_block.entity_table',
216 'table_name' => 'civicrm_pcp_block',
217 'entity' => 'PCPBlock',
218 'bao' => 'CRM_PCP_BAO_PCPBlock',
223 'name' => 'entity_id',
224 'type' => CRM_Utils_Type
::T_INT
,
225 'title' => ts('Entity'),
226 'description' => ts('FK to civicrm_contribution_page.id OR civicrm_event.id'),
228 'where' => 'civicrm_pcp_block.entity_id',
229 'table_name' => 'civicrm_pcp_block',
230 'entity' => 'PCPBlock',
231 'bao' => 'CRM_PCP_BAO_PCPBlock',
235 'target_entity_type' => [
236 'name' => 'target_entity_type',
237 'type' => CRM_Utils_Type
::T_STRING
,
238 'title' => ts('Target Entity'),
239 'description' => ts('The type of entity that this pcp targets'),
242 'size' => CRM_Utils_Type
::HUGE
,
243 'where' => 'civicrm_pcp_block.target_entity_type',
244 'default' => 'contribute',
245 'table_name' => 'civicrm_pcp_block',
246 'entity' => 'PCPBlock',
247 'bao' => 'CRM_PCP_BAO_PCPBlock',
251 'target_entity_id' => [
252 'name' => 'target_entity_id',
253 'type' => CRM_Utils_Type
::T_INT
,
254 'title' => ts('Target Entity ID'),
255 'description' => ts('The entity that this pcp targets'),
257 'where' => 'civicrm_pcp_block.target_entity_id',
258 'table_name' => 'civicrm_pcp_block',
259 'entity' => 'PCPBlock',
260 'bao' => 'CRM_PCP_BAO_PCPBlock',
264 'supporter_profile_id' => [
265 'name' => 'supporter_profile_id',
266 'type' => CRM_Utils_Type
::T_INT
,
267 'title' => ts('Supporter Profile ID'),
268 'description' => ts('FK to civicrm_uf_group.id. Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?'),
269 'where' => 'civicrm_pcp_block.supporter_profile_id',
271 'table_name' => 'civicrm_pcp_block',
272 'entity' => 'PCPBlock',
273 'bao' => 'CRM_PCP_BAO_PCPBlock',
275 'FKClassName' => 'CRM_Core_DAO_UFGroup',
277 'label' => ts("Supporter Profile"),
281 'owner_notify_id' => [
282 'name' => 'owner_notify_id',
283 'type' => CRM_Utils_Type
::T_INT
,
284 'title' => ts('Owner Notification'),
285 'description' => ts('FK to civicrm_option_group with name = PCP owner notifications'),
286 'where' => 'civicrm_pcp_block.owner_notify_id',
288 'table_name' => 'civicrm_pcp_block',
289 'entity' => 'PCPBlock',
290 'bao' => 'CRM_PCP_BAO_PCPBlock',
295 'pseudoconstant' => [
296 'optionGroupName' => 'pcp_owner_notify',
297 'optionEditPath' => 'civicrm/admin/options/pcp_owner_notify',
301 'is_approval_needed' => [
302 'name' => 'is_approval_needed',
303 'type' => CRM_Utils_Type
::T_BOOLEAN
,
304 'title' => ts('Approval Required?'),
305 'description' => ts('Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?'),
306 'where' => 'civicrm_pcp_block.is_approval_needed',
308 'table_name' => 'civicrm_pcp_block',
309 'entity' => 'PCPBlock',
310 'bao' => 'CRM_PCP_BAO_PCPBlock',
314 'is_tellfriend_enabled' => [
315 'name' => 'is_tellfriend_enabled',
316 'type' => CRM_Utils_Type
::T_BOOLEAN
,
317 'title' => ts('Tell a Friend Enabled?'),
318 'description' => ts('Does Personal Campaign Page allow using tell a friend?'),
319 'where' => 'civicrm_pcp_block.is_tellfriend_enabled',
321 'table_name' => 'civicrm_pcp_block',
322 'entity' => 'PCPBlock',
323 'bao' => 'CRM_PCP_BAO_PCPBlock',
327 'tellfriend_limit' => [
328 'name' => 'tellfriend_limit',
329 'type' => CRM_Utils_Type
::T_INT
,
330 'title' => ts('Tell A Friend Limit'),
331 'description' => ts('Maximum recipient fields allowed in tell a friend'),
332 'where' => 'civicrm_pcp_block.tellfriend_limit',
334 'table_name' => 'civicrm_pcp_block',
335 'entity' => 'PCPBlock',
336 'bao' => 'CRM_PCP_BAO_PCPBlock',
341 'name' => 'link_text',
342 'type' => CRM_Utils_Type
::T_STRING
,
343 'title' => ts('Link Text'),
344 'description' => ts('Link text for PCP.'),
346 'size' => CRM_Utils_Type
::HUGE
,
347 'where' => 'civicrm_pcp_block.link_text',
349 'table_name' => 'civicrm_pcp_block',
350 'entity' => 'PCPBlock',
351 'bao' => 'CRM_PCP_BAO_PCPBlock',
356 'name' => 'is_active',
357 'type' => CRM_Utils_Type
::T_BOOLEAN
,
358 'title' => ts('Enabled?'),
359 'description' => ts('Is Personal Campaign Page Block enabled/active?'),
360 'where' => 'civicrm_pcp_block.is_active',
362 'table_name' => 'civicrm_pcp_block',
363 'entity' => 'PCPBlock',
364 'bao' => 'CRM_PCP_BAO_PCPBlock',
369 'name' => 'notify_email',
370 'type' => CRM_Utils_Type
::T_STRING
,
371 'title' => ts('Notification Email'),
372 'description' => ts('If set, notification is automatically emailed to this email-address on create/update Personal Campaign Page'),
374 'size' => CRM_Utils_Type
::HUGE
,
375 'where' => 'civicrm_pcp_block.notify_email',
377 'table_name' => 'civicrm_pcp_block',
378 'entity' => 'PCPBlock',
379 'bao' => 'CRM_PCP_BAO_PCPBlock',
384 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
386 return Civi
::$statics[__CLASS__
]['fields'];
390 * Return a mapping from field-name to the corresponding key (as used in fields()).
393 * Array(string $name => string $uniqueName).
395 public static function &fieldKeys() {
396 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
397 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
399 return Civi
::$statics[__CLASS__
]['fieldKeys'];
403 * Returns the names of this table
407 public static function getTableName() {
408 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
412 * Returns if this table needs to be logged
416 public function getLog() {
421 * Returns the list of fields that can be imported
423 * @param bool $prefix
427 public static function &import($prefix = FALSE) {
428 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pcp_block', $prefix, []);
433 * Returns the list of fields that can be exported
435 * @param bool $prefix
439 public static function &export($prefix = FALSE) {
440 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pcp_block', $prefix, []);
445 * Returns the list of indices
447 * @param bool $localize
451 public static function indices($localize = TRUE) {
453 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;