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:19658f7692f6185ddf125d80f236aede)
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',
171 'entity_table' => array(
172 'name' => 'entity_table',
173 'type' => CRM_Utils_Type
::T_STRING
,
174 'title' => ts('Entity Table') ,
176 'size' => CRM_Utils_Type
::BIG
,
177 'table_name' => 'civicrm_pcp_block',
178 'entity' => 'PCPBlock',
179 'bao' => 'CRM_PCP_BAO_PCPBlock',
181 'entity_id' => array(
182 'name' => 'entity_id',
183 'type' => CRM_Utils_Type
::T_INT
,
184 'title' => ts('Entity') ,
185 'description' => 'FK to civicrm_contribution_page.id OR civicrm_event.id',
187 'table_name' => 'civicrm_pcp_block',
188 'entity' => 'PCPBlock',
189 'bao' => 'CRM_PCP_BAO_PCPBlock',
191 'target_entity_type' => array(
192 'name' => 'target_entity_type',
193 'type' => CRM_Utils_Type
::T_STRING
,
194 'title' => ts('Target Entity') ,
195 'description' => 'The type of entity that this pcp targets',
198 'size' => CRM_Utils_Type
::HUGE
,
199 'default' => 'contribute',
200 'table_name' => 'civicrm_pcp_block',
201 'entity' => 'PCPBlock',
202 'bao' => 'CRM_PCP_BAO_PCPBlock',
204 'target_entity_id' => array(
205 'name' => 'target_entity_id',
206 'type' => CRM_Utils_Type
::T_INT
,
207 'title' => ts('Target Entity ID') ,
208 'description' => 'The entity that this pcp targets',
210 'table_name' => 'civicrm_pcp_block',
211 'entity' => 'PCPBlock',
212 'bao' => 'CRM_PCP_BAO_PCPBlock',
214 'supporter_profile_id' => array(
215 'name' => 'supporter_profile_id',
216 'type' => CRM_Utils_Type
::T_INT
,
217 'title' => ts('Supporter Profile') ,
218 'description' => 'FK to civicrm_uf_group.id. Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?',
220 'table_name' => 'civicrm_pcp_block',
221 'entity' => 'PCPBlock',
222 'bao' => 'CRM_PCP_BAO_PCPBlock',
223 'FKClassName' => 'CRM_Core_DAO_UFGroup',
225 'owner_notify_id' => array(
226 'name' => 'owner_notify_id',
227 'type' => CRM_Utils_Type
::T_INT
,
228 'title' => ts('Owner Notification') ,
229 'description' => 'FK to civicrm_option_group with name = PCP owner notifications',
230 'table_name' => 'civicrm_pcp_block',
231 'entity' => 'PCPBlock',
232 'bao' => 'CRM_PCP_BAO_PCPBlock',
236 'pseudoconstant' => array(
237 'optionGroupName' => 'pcp_owner_notify',
238 'optionEditPath' => 'civicrm/admin/options/pcp_owner_notify',
241 'is_approval_needed' => array(
242 'name' => 'is_approval_needed',
243 'type' => CRM_Utils_Type
::T_BOOLEAN
,
244 'title' => ts('Approval Required?') ,
245 'description' => 'Does Personal Campaign Page require manual activation by administrator? (is inactive by default after setup)?',
247 'table_name' => 'civicrm_pcp_block',
248 'entity' => 'PCPBlock',
249 'bao' => 'CRM_PCP_BAO_PCPBlock',
251 'is_tellfriend_enabled' => array(
252 'name' => 'is_tellfriend_enabled',
253 'type' => CRM_Utils_Type
::T_BOOLEAN
,
254 'title' => ts('Tell a Friend Enabled?') ,
255 'description' => 'Does Personal Campaign Page allow using tell a friend?',
257 'table_name' => 'civicrm_pcp_block',
258 'entity' => 'PCPBlock',
259 'bao' => 'CRM_PCP_BAO_PCPBlock',
261 'tellfriend_limit' => array(
262 'name' => 'tellfriend_limit',
263 'type' => CRM_Utils_Type
::T_INT
,
264 'title' => ts('Tell A Friend Limit') ,
265 'description' => 'Maximum recipient fields allowed in tell a friend',
267 'table_name' => 'civicrm_pcp_block',
268 'entity' => 'PCPBlock',
269 'bao' => 'CRM_PCP_BAO_PCPBlock',
271 'link_text' => array(
272 'name' => 'link_text',
273 'type' => CRM_Utils_Type
::T_STRING
,
274 'title' => ts('Link Text') ,
275 'description' => 'Link text for PCP.',
277 'size' => CRM_Utils_Type
::HUGE
,
279 'table_name' => 'civicrm_pcp_block',
280 'entity' => 'PCPBlock',
281 'bao' => 'CRM_PCP_BAO_PCPBlock',
283 'is_active' => array(
284 'name' => 'is_active',
285 'type' => CRM_Utils_Type
::T_BOOLEAN
,
286 'title' => ts('Enabled?') ,
287 'description' => 'Is Personal Campaign Page Block enabled/active?',
289 'table_name' => 'civicrm_pcp_block',
290 'entity' => 'PCPBlock',
291 'bao' => 'CRM_PCP_BAO_PCPBlock',
293 'notify_email' => array(
294 'name' => 'notify_email',
295 'type' => CRM_Utils_Type
::T_STRING
,
296 'title' => ts('Notification Email') ,
297 'description' => 'If set, notification is automatically emailed to this email-address on create/update Personal Campaign Page',
299 'size' => CRM_Utils_Type
::HUGE
,
301 'table_name' => 'civicrm_pcp_block',
302 'entity' => 'PCPBlock',
303 'bao' => 'CRM_PCP_BAO_PCPBlock',
306 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
308 return Civi
::$statics[__CLASS__
]['fields'];
311 * Return a mapping from field-name to the corresponding key (as used in fields()).
314 * Array(string $name => string $uniqueName).
316 static function &fieldKeys() {
317 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
318 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
320 return Civi
::$statics[__CLASS__
]['fieldKeys'];
323 * Returns the names of this table
327 static function getTableName() {
328 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
331 * Returns if this table needs to be logged
339 * Returns the list of fields that can be imported
341 * @param bool $prefix
345 static function &import($prefix = false) {
346 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pcp_block', $prefix, array());
350 * Returns the list of fields that can be exported
352 * @param bool $prefix
356 static function &export($prefix = false) {
357 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pcp_block', $prefix, array());