3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/PCP/PCPBlock.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:5e7c52122eb7d5b428bb717c7c634327)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_PCP_DAO_PCPBlock constructor.
40 class CRM_PCP_DAO_PCPBlock
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_pcp_block';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
65 * FK to civicrm_contribution_page.id OR civicrm_event.id
71 * The type of entity that this pcp targets
75 public $target_entity_type;
77 * The entity that this pcp targets
81 public $target_entity_id;
83 * FK to civicrm_uf_group.id. Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?
87 public $supporter_profile_id;
89 * FK to civicrm_option_group with name = PCP owner notifications
93 public $owner_notify_id;
95 * Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?
99 public $is_approval_needed;
101 * Does Personal Campaign Page allow using tell a friend?
105 public $is_tellfriend_enabled;
107 * Maximum recipient fields allowed in tell a friend
111 public $tellfriend_limit;
119 * Is Personal Campaign Page Block enabled/active?
125 * If set, notification is automatically emailed to this email-address on create/update Personal Campaign Page
129 public $notify_email;
133 function __construct() {
134 $this->__table
= 'civicrm_pcp_block';
135 parent
::__construct();
138 * Returns foreign keys and entity references.
141 * [CRM_Core_Reference_Interface]
143 static function getReferenceColumns() {
144 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
145 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
146 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'supporter_profile_id', 'civicrm_uf_group', 'id');
147 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
148 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'target_entity_id', NULL, 'id', 'target_entity_type');
149 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
151 return Civi
::$statics[__CLASS__
]['links'];
154 * Returns all the column names of this table
158 static function &fields() {
159 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
160 Civi
::$statics[__CLASS__
]['fields'] = array(
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('PCP Block ID') ,
165 'description' => 'PCP block Id',
167 'table_name' => 'civicrm_pcp_block',
168 'entity' => 'PCPBlock',
169 'bao' => 'CRM_PCP_BAO_PCPBlock',
172 'entity_table' => array(
173 'name' => 'entity_table',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Entity Table') ,
177 'size' => CRM_Utils_Type
::BIG
,
178 'table_name' => 'civicrm_pcp_block',
179 'entity' => 'PCPBlock',
180 'bao' => 'CRM_PCP_BAO_PCPBlock',
183 'entity_id' => array(
184 'name' => 'entity_id',
185 'type' => CRM_Utils_Type
::T_INT
,
186 'title' => ts('Entity') ,
187 'description' => 'FK to civicrm_contribution_page.id OR civicrm_event.id',
189 'table_name' => 'civicrm_pcp_block',
190 'entity' => 'PCPBlock',
191 'bao' => 'CRM_PCP_BAO_PCPBlock',
194 'target_entity_type' => array(
195 'name' => 'target_entity_type',
196 'type' => CRM_Utils_Type
::T_STRING
,
197 'title' => ts('Target Entity') ,
198 'description' => 'The type of entity that this pcp targets',
201 'size' => CRM_Utils_Type
::HUGE
,
202 'default' => 'contribute',
203 'table_name' => 'civicrm_pcp_block',
204 'entity' => 'PCPBlock',
205 'bao' => 'CRM_PCP_BAO_PCPBlock',
208 'target_entity_id' => array(
209 'name' => 'target_entity_id',
210 'type' => CRM_Utils_Type
::T_INT
,
211 'title' => ts('Target Entity ID') ,
212 'description' => 'The entity that this pcp targets',
214 'table_name' => 'civicrm_pcp_block',
215 'entity' => 'PCPBlock',
216 'bao' => 'CRM_PCP_BAO_PCPBlock',
219 'supporter_profile_id' => array(
220 'name' => 'supporter_profile_id',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Supporter Profile') ,
223 'description' => 'FK to civicrm_uf_group.id. Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?',
225 'table_name' => 'civicrm_pcp_block',
226 'entity' => 'PCPBlock',
227 'bao' => 'CRM_PCP_BAO_PCPBlock',
229 'FKClassName' => 'CRM_Core_DAO_UFGroup',
231 'owner_notify_id' => array(
232 'name' => 'owner_notify_id',
233 'type' => CRM_Utils_Type
::T_INT
,
234 'title' => ts('Owner Notification') ,
235 'description' => 'FK to civicrm_option_group with name = PCP owner notifications',
236 'table_name' => 'civicrm_pcp_block',
237 'entity' => 'PCPBlock',
238 'bao' => 'CRM_PCP_BAO_PCPBlock',
243 'pseudoconstant' => array(
244 'optionGroupName' => 'pcp_owner_notify',
245 'optionEditPath' => 'civicrm/admin/options/pcp_owner_notify',
248 'is_approval_needed' => array(
249 'name' => 'is_approval_needed',
250 'type' => CRM_Utils_Type
::T_BOOLEAN
,
251 'title' => ts('Approval Required?') ,
252 'description' => 'Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?',
254 'table_name' => 'civicrm_pcp_block',
255 'entity' => 'PCPBlock',
256 'bao' => 'CRM_PCP_BAO_PCPBlock',
259 'is_tellfriend_enabled' => array(
260 'name' => 'is_tellfriend_enabled',
261 'type' => CRM_Utils_Type
::T_BOOLEAN
,
262 'title' => ts('Tell a Friend Enabled?') ,
263 'description' => 'Does Personal Campaign Page allow using tell a friend?',
265 'table_name' => 'civicrm_pcp_block',
266 'entity' => 'PCPBlock',
267 'bao' => 'CRM_PCP_BAO_PCPBlock',
270 'tellfriend_limit' => array(
271 'name' => 'tellfriend_limit',
272 'type' => CRM_Utils_Type
::T_INT
,
273 'title' => ts('Tell A Friend Limit') ,
274 'description' => 'Maximum recipient fields allowed in tell a friend',
276 'table_name' => 'civicrm_pcp_block',
277 'entity' => 'PCPBlock',
278 'bao' => 'CRM_PCP_BAO_PCPBlock',
281 'link_text' => array(
282 'name' => 'link_text',
283 'type' => CRM_Utils_Type
::T_STRING
,
284 'title' => ts('Link Text') ,
285 'description' => 'Link text for PCP.',
287 'size' => CRM_Utils_Type
::HUGE
,
289 'table_name' => 'civicrm_pcp_block',
290 'entity' => 'PCPBlock',
291 'bao' => 'CRM_PCP_BAO_PCPBlock',
294 'is_active' => array(
295 'name' => 'is_active',
296 'type' => CRM_Utils_Type
::T_BOOLEAN
,
297 'title' => ts('Enabled?') ,
298 'description' => 'Is Personal Campaign Page Block enabled/active?',
300 'table_name' => 'civicrm_pcp_block',
301 'entity' => 'PCPBlock',
302 'bao' => 'CRM_PCP_BAO_PCPBlock',
305 'notify_email' => array(
306 'name' => 'notify_email',
307 'type' => CRM_Utils_Type
::T_STRING
,
308 'title' => ts('Notification Email') ,
309 'description' => 'If set, notification is automatically emailed to this email-address on create/update Personal Campaign Page',
311 'size' => CRM_Utils_Type
::HUGE
,
313 'table_name' => 'civicrm_pcp_block',
314 'entity' => 'PCPBlock',
315 'bao' => 'CRM_PCP_BAO_PCPBlock',
319 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
321 return Civi
::$statics[__CLASS__
]['fields'];
324 * Return a mapping from field-name to the corresponding key (as used in fields()).
327 * Array(string $name => string $uniqueName).
329 static function &fieldKeys() {
330 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
331 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
333 return Civi
::$statics[__CLASS__
]['fieldKeys'];
336 * Returns the names of this table
340 static function getTableName() {
341 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
344 * Returns if this table needs to be logged
352 * Returns the list of fields that can be imported
354 * @param bool $prefix
358 static function &import($prefix = false) {
359 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pcp_block', $prefix, array());
363 * Returns the list of fields that can be exported
365 * @param bool $prefix
369 static function &export($prefix = false) {
370 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pcp_block', $prefix, array());
374 * Returns the list of indices
376 public static function indices($localize = TRUE) {
378 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;