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/PCP.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:55283776659b636af6e8511f8978d660)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_PCP_DAO_PCP constructor.
40 class CRM_PCP_DAO_PCP
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_pcp';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
54 * Personal Campaign Page ID
89 public $donate_link_text;
91 * The Contribution or Event Page which triggered this pcp
97 * The type of PCP this is: contribute or event
103 * The pcp block that this pcp page was created from
107 public $pcp_block_id;
112 public $is_thermometer;
117 public $is_honor_roll;
119 * Goal amount of this Personal Campaign Page.
125 * 3 character string, value from config setting or input via user.
131 * Is Personal Campaign Page enabled/active?
137 * Notify owner via email when someone donates to page?
145 function __construct() {
146 $this->__table
= 'civicrm_pcp';
147 parent
::__construct();
150 * Returns foreign keys and entity references.
153 * [CRM_Core_Reference_Interface]
155 static function getReferenceColumns() {
156 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
157 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
158 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
159 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
161 return Civi
::$statics[__CLASS__
]['links'];
164 * Returns all the column names of this table
168 static function &fields() {
169 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
170 Civi
::$statics[__CLASS__
]['fields'] = array(
173 'type' => CRM_Utils_Type
::T_INT
,
174 'title' => ts('Personal Campaign Page ID') ,
175 'description' => 'Personal Campaign Page ID',
177 'table_name' => 'civicrm_pcp',
179 'bao' => 'CRM_PCP_BAO_PCP',
182 'pcp_contact_id' => array(
183 'name' => 'contact_id',
184 'type' => CRM_Utils_Type
::T_INT
,
185 'title' => ts('Contact ID') ,
186 'description' => 'FK to Contact ID',
188 'table_name' => 'civicrm_pcp',
190 'bao' => 'CRM_PCP_BAO_PCP',
192 'FKClassName' => 'CRM_Contact_DAO_Contact',
194 'type' => 'EntityRef',
197 'status_id' => array(
198 'name' => 'status_id',
199 'type' => CRM_Utils_Type
::T_INT
,
200 'title' => ts('Personal Campaign Page Status') ,
202 'table_name' => 'civicrm_pcp',
204 'bao' => 'CRM_PCP_BAO_PCP',
209 'pseudoconstant' => array(
210 'optionGroupName' => 'pcp_status',
211 'optionEditPath' => 'civicrm/admin/options/pcp_status',
216 'type' => CRM_Utils_Type
::T_STRING
,
217 'title' => ts('Personal Campaign Page Title') ,
219 'size' => CRM_Utils_Type
::HUGE
,
221 'table_name' => 'civicrm_pcp',
223 'bao' => 'CRM_PCP_BAO_PCP',
229 'intro_text' => array(
230 'name' => 'intro_text',
231 'type' => CRM_Utils_Type
::T_TEXT
,
232 'title' => ts('Intro Text') ,
234 'table_name' => 'civicrm_pcp',
236 'bao' => 'CRM_PCP_BAO_PCP',
242 'page_text' => array(
243 'name' => 'page_text',
244 'type' => CRM_Utils_Type
::T_TEXT
,
245 'title' => ts('Page Text') ,
247 'table_name' => 'civicrm_pcp',
249 'bao' => 'CRM_PCP_BAO_PCP',
255 'donate_link_text' => array(
256 'name' => 'donate_link_text',
257 'type' => CRM_Utils_Type
::T_STRING
,
258 'title' => ts('Donate Link Text') ,
260 'size' => CRM_Utils_Type
::HUGE
,
262 'table_name' => 'civicrm_pcp',
264 'bao' => 'CRM_PCP_BAO_PCP',
272 'type' => CRM_Utils_Type
::T_INT
,
273 'title' => ts('Contribution Page') ,
274 'description' => 'The Contribution or Event Page which triggered this pcp',
276 'table_name' => 'civicrm_pcp',
278 'bao' => 'CRM_PCP_BAO_PCP',
281 'page_type' => array(
282 'name' => 'page_type',
283 'type' => CRM_Utils_Type
::T_STRING
,
284 'title' => ts('PCP Page Type') ,
285 'description' => 'The type of PCP this is: contribute or event',
287 'size' => CRM_Utils_Type
::BIG
,
288 'default' => 'contribute',
289 'table_name' => 'civicrm_pcp',
291 'bao' => 'CRM_PCP_BAO_PCP',
297 'pcp_block_id' => array(
298 'name' => 'pcp_block_id',
299 'type' => CRM_Utils_Type
::T_INT
,
300 'title' => ts('PCP Block') ,
301 'description' => 'The pcp block that this pcp page was created from',
303 'table_name' => 'civicrm_pcp',
305 'bao' => 'CRM_PCP_BAO_PCP',
308 'is_thermometer' => array(
309 'name' => 'is_thermometer',
310 'type' => CRM_Utils_Type
::T_INT
,
311 'title' => ts('Use Thermometer?') ,
312 'table_name' => 'civicrm_pcp',
314 'bao' => 'CRM_PCP_BAO_PCP',
317 'type' => 'CheckBox',
320 'is_honor_roll' => array(
321 'name' => 'is_honor_roll',
322 'type' => CRM_Utils_Type
::T_INT
,
323 'title' => ts('Show Honor Roll?') ,
324 'table_name' => 'civicrm_pcp',
326 'bao' => 'CRM_PCP_BAO_PCP',
329 'type' => 'CheckBox',
332 'goal_amount' => array(
333 'name' => 'goal_amount',
334 'type' => CRM_Utils_Type
::T_MONEY
,
335 'title' => ts('Goal Amount') ,
336 'description' => 'Goal amount of this Personal Campaign Page.',
337 'precision' => array(
341 'table_name' => 'civicrm_pcp',
343 'bao' => 'CRM_PCP_BAO_PCP',
350 'name' => 'currency',
351 'type' => CRM_Utils_Type
::T_STRING
,
352 'title' => ts('Currency') ,
353 'description' => '3 character string, value from config setting or input via user.',
355 'size' => CRM_Utils_Type
::FOUR
,
357 'table_name' => 'civicrm_pcp',
359 'bao' => 'CRM_PCP_BAO_PCP',
364 'pseudoconstant' => array(
365 'table' => 'civicrm_currency',
366 'keyColumn' => 'name',
367 'labelColumn' => 'full_name',
368 'nameColumn' => 'name',
371 'is_active' => array(
372 'name' => 'is_active',
373 'type' => CRM_Utils_Type
::T_BOOLEAN
,
374 'title' => ts('Enabled?') ,
375 'description' => 'Is Personal Campaign Page enabled/active?',
376 'table_name' => 'civicrm_pcp',
378 'bao' => 'CRM_PCP_BAO_PCP',
381 'type' => 'CheckBox',
384 'is_notify' => array(
385 'name' => 'is_notify',
386 'type' => CRM_Utils_Type
::T_BOOLEAN
,
387 'title' => ts('Notify Owner?') ,
388 'description' => 'Notify owner via email when someone donates to page?',
389 'table_name' => 'civicrm_pcp',
391 'bao' => 'CRM_PCP_BAO_PCP',
394 'type' => 'CheckBox',
398 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
400 return Civi
::$statics[__CLASS__
]['fields'];
403 * Return a mapping from field-name to the corresponding key (as used in fields()).
406 * Array(string $name => string $uniqueName).
408 static function &fieldKeys() {
409 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
410 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
412 return Civi
::$statics[__CLASS__
]['fieldKeys'];
415 * Returns the names of this table
419 static function getTableName() {
420 return self
::$_tableName;
423 * Returns if this table needs to be logged
431 * Returns the list of fields that can be imported
433 * @param bool $prefix
437 static function &import($prefix = false) {
438 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pcp', $prefix, array());
442 * Returns the list of fields that can be exported
444 * @param bool $prefix
448 static function &export($prefix = false) {
449 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pcp', $prefix, array());
453 * Returns the list of indices
455 public static function indices($localize = TRUE) {
457 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;