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',
181 'pcp_contact_id' => array(
182 'name' => 'contact_id',
183 'type' => CRM_Utils_Type
::T_INT
,
184 'title' => ts('Contact ID') ,
185 'description' => 'FK to Contact ID',
187 'table_name' => 'civicrm_pcp',
189 'bao' => 'CRM_PCP_BAO_PCP',
190 'FKClassName' => 'CRM_Contact_DAO_Contact',
192 'type' => 'EntityRef',
195 'status_id' => array(
196 'name' => 'status_id',
197 'type' => CRM_Utils_Type
::T_INT
,
198 'title' => ts('Personal Campaign Page Status') ,
200 'table_name' => 'civicrm_pcp',
202 'bao' => 'CRM_PCP_BAO_PCP',
206 'pseudoconstant' => array(
207 'optionGroupName' => 'pcp_status',
208 'optionEditPath' => 'civicrm/admin/options/pcp_status',
213 'type' => CRM_Utils_Type
::T_STRING
,
214 'title' => ts('Personal Campaign Page Title') ,
216 'size' => CRM_Utils_Type
::HUGE
,
218 'table_name' => 'civicrm_pcp',
220 'bao' => 'CRM_PCP_BAO_PCP',
225 'intro_text' => array(
226 'name' => 'intro_text',
227 'type' => CRM_Utils_Type
::T_TEXT
,
228 'title' => ts('Intro Text') ,
230 'table_name' => 'civicrm_pcp',
232 'bao' => 'CRM_PCP_BAO_PCP',
237 'page_text' => array(
238 'name' => 'page_text',
239 'type' => CRM_Utils_Type
::T_TEXT
,
240 'title' => ts('Page Text') ,
242 'table_name' => 'civicrm_pcp',
244 'bao' => 'CRM_PCP_BAO_PCP',
249 'donate_link_text' => array(
250 'name' => 'donate_link_text',
251 'type' => CRM_Utils_Type
::T_STRING
,
252 'title' => ts('Donate Link Text') ,
254 'size' => CRM_Utils_Type
::HUGE
,
256 'table_name' => 'civicrm_pcp',
258 'bao' => 'CRM_PCP_BAO_PCP',
265 'type' => CRM_Utils_Type
::T_INT
,
266 'title' => ts('Contribution Page') ,
267 'description' => 'The Contribution or Event Page which triggered this pcp',
269 'table_name' => 'civicrm_pcp',
271 'bao' => 'CRM_PCP_BAO_PCP',
273 'page_type' => array(
274 'name' => 'page_type',
275 'type' => CRM_Utils_Type
::T_STRING
,
276 'title' => ts('PCP Page Type') ,
277 'description' => 'The type of PCP this is: contribute or event',
279 'size' => CRM_Utils_Type
::BIG
,
280 'default' => 'contribute',
281 'table_name' => 'civicrm_pcp',
283 'bao' => 'CRM_PCP_BAO_PCP',
288 'pcp_block_id' => array(
289 'name' => 'pcp_block_id',
290 'type' => CRM_Utils_Type
::T_INT
,
291 'title' => ts('PCP Block') ,
292 'description' => 'The pcp block that this pcp page was created from',
294 'table_name' => 'civicrm_pcp',
296 'bao' => 'CRM_PCP_BAO_PCP',
298 'is_thermometer' => array(
299 'name' => 'is_thermometer',
300 'type' => CRM_Utils_Type
::T_INT
,
301 'title' => ts('Use Thermometer?') ,
302 'table_name' => 'civicrm_pcp',
304 'bao' => 'CRM_PCP_BAO_PCP',
306 'type' => 'CheckBox',
309 'is_honor_roll' => array(
310 'name' => 'is_honor_roll',
311 'type' => CRM_Utils_Type
::T_INT
,
312 'title' => ts('Show Honor Roll?') ,
313 'table_name' => 'civicrm_pcp',
315 'bao' => 'CRM_PCP_BAO_PCP',
317 'type' => 'CheckBox',
320 'goal_amount' => array(
321 'name' => 'goal_amount',
322 'type' => CRM_Utils_Type
::T_MONEY
,
323 'title' => ts('Goal Amount') ,
324 'description' => 'Goal amount of this Personal Campaign Page.',
325 'precision' => array(
329 'table_name' => 'civicrm_pcp',
331 'bao' => 'CRM_PCP_BAO_PCP',
337 'name' => 'currency',
338 'type' => CRM_Utils_Type
::T_STRING
,
339 'title' => ts('Currency') ,
340 'description' => '3 character string, value from config setting or input via user.',
342 'size' => CRM_Utils_Type
::FOUR
,
344 'table_name' => 'civicrm_pcp',
346 'bao' => 'CRM_PCP_BAO_PCP',
350 'pseudoconstant' => array(
351 'table' => 'civicrm_currency',
352 'keyColumn' => 'name',
353 'labelColumn' => 'full_name',
354 'nameColumn' => 'name',
357 'is_active' => array(
358 'name' => 'is_active',
359 'type' => CRM_Utils_Type
::T_BOOLEAN
,
360 'title' => ts('Enabled?') ,
361 'description' => 'Is Personal Campaign Page enabled/active?',
362 'table_name' => 'civicrm_pcp',
364 'bao' => 'CRM_PCP_BAO_PCP',
366 'type' => 'CheckBox',
369 'is_notify' => array(
370 'name' => 'is_notify',
371 'type' => CRM_Utils_Type
::T_BOOLEAN
,
372 'title' => ts('Notify Owner?') ,
373 'description' => 'Notify owner via email when someone donates to page?',
374 'table_name' => 'civicrm_pcp',
376 'bao' => 'CRM_PCP_BAO_PCP',
378 'type' => 'CheckBox',
382 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
384 return Civi
::$statics[__CLASS__
]['fields'];
387 * Return a mapping from field-name to the corresponding key (as used in fields()).
390 * Array(string $name => string $uniqueName).
392 static function &fieldKeys() {
393 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
394 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
396 return Civi
::$statics[__CLASS__
]['fieldKeys'];
399 * Returns the names of this table
403 static function getTableName() {
404 return self
::$_tableName;
407 * Returns if this table needs to be logged
415 * Returns the list of fields that can be imported
417 * @param bool $prefix
421 static function &import($prefix = false) {
422 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pcp', $prefix, array());
426 * Returns the list of fields that can be exported
428 * @param bool $prefix
432 static function &export($prefix = false) {
433 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pcp', $prefix, array());