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/Campaign/Survey.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:55aa9d31d08f8b5353d42dde1278b7f2)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Campaign_DAO_Survey constructor.
40 class CRM_Campaign_DAO_Survey
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_survey';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Title of the Survey.
66 * Foreign key to the Campaign.
72 * Implicit FK to civicrm_option_value where option_group = activity_type
76 public $activity_type_id;
78 * Recontact intervals for each status.
82 public $recontact_interval;
84 * Script instructions for volunteers to use for the survey.
90 * Number of days for recurrence of release.
94 public $release_frequency;
96 * Maximum number of contacts to allow for survey.
100 public $max_number_of_contacts;
102 * Default number of contacts to allow for survey.
106 public $default_number_of_contacts;
108 * Is this survey enabled or disabled/cancelled?
114 * Is this default survey?
120 * FK to civicrm_contact, who created this Survey.
126 * Date and time that Survey was created.
130 public $created_date;
132 * FK to civicrm_contact, who recently edited this Survey.
136 public $last_modified_id;
138 * Date and time that Survey was edited last time.
142 public $last_modified_date;
144 * Used to store option group id.
150 * Bypass the email verification.
154 public $bypass_confirm;
156 * Title for Thank-you page (header title tag, and display at the top of the page).
160 public $thankyou_title;
162 * text and html allowed. displayed above result on success page
166 public $thankyou_text;
168 * Can people share the petition through social media?
176 function __construct() {
177 $this->__table
= 'civicrm_survey';
178 parent
::__construct();
181 * Returns foreign keys and entity references.
184 * [CRM_Core_Reference_Interface]
186 static function getReferenceColumns() {
187 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
188 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
189 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
190 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
191 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'last_modified_id', 'civicrm_contact', 'id');
192 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
194 return Civi
::$statics[__CLASS__
]['links'];
197 * Returns all the column names of this table
201 static function &fields() {
202 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
203 Civi
::$statics[__CLASS__
]['fields'] = array(
206 'type' => CRM_Utils_Type
::T_INT
,
207 'title' => ts('Survey ID') ,
208 'description' => 'Survey id.',
210 'table_name' => 'civicrm_survey',
211 'entity' => 'Survey',
212 'bao' => 'CRM_Campaign_BAO_Survey',
217 'type' => CRM_Utils_Type
::T_STRING
,
218 'title' => ts('Survey Title') ,
219 'description' => 'Title of the Survey.',
222 'size' => CRM_Utils_Type
::HUGE
,
224 'where' => 'civicrm_survey.title',
225 'headerPattern' => '',
228 'table_name' => 'civicrm_survey',
229 'entity' => 'Survey',
230 'bao' => 'CRM_Campaign_BAO_Survey',
233 'campaign_id' => array(
234 'name' => 'campaign_id',
235 'type' => CRM_Utils_Type
::T_INT
,
236 'title' => ts('Survey Campaign ID') ,
237 'description' => 'Foreign key to the Campaign.',
239 'table_name' => 'civicrm_survey',
240 'entity' => 'Survey',
241 'bao' => 'CRM_Campaign_BAO_Survey',
243 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
244 'pseudoconstant' => array(
245 'table' => 'civicrm_campaign',
247 'labelColumn' => 'title',
250 'activity_type_id' => array(
251 'name' => 'activity_type_id',
252 'type' => CRM_Utils_Type
::T_INT
,
253 'title' => ts('Activity Type') ,
254 'description' => 'Implicit FK to civicrm_option_value where option_group = activity_type',
256 'where' => 'civicrm_survey.activity_type_id',
257 'headerPattern' => '',
261 'table_name' => 'civicrm_survey',
262 'entity' => 'Survey',
263 'bao' => 'CRM_Campaign_BAO_Survey',
268 'pseudoconstant' => array(
269 'optionGroupName' => 'activity_type',
270 'optionEditPath' => 'civicrm/admin/options/activity_type',
273 'recontact_interval' => array(
274 'name' => 'recontact_interval',
275 'type' => CRM_Utils_Type
::T_TEXT
,
276 'title' => ts('Follow up Interval') ,
277 'description' => 'Recontact intervals for each status.',
280 'table_name' => 'civicrm_survey',
281 'entity' => 'Survey',
282 'bao' => 'CRM_Campaign_BAO_Survey',
285 'type' => 'TextArea',
288 'instructions' => array(
289 'name' => 'instructions',
290 'type' => CRM_Utils_Type
::T_TEXT
,
291 'title' => ts('Instructions') ,
292 'description' => 'Script instructions for volunteers to use for the survey.',
295 'table_name' => 'civicrm_survey',
296 'entity' => 'Survey',
297 'bao' => 'CRM_Campaign_BAO_Survey',
300 'type' => 'TextArea',
303 'release_frequency' => array(
304 'name' => 'release_frequency',
305 'type' => CRM_Utils_Type
::T_INT
,
306 'title' => ts('Survey Hold Duration') ,
307 'description' => 'Number of days for recurrence of release.',
309 'table_name' => 'civicrm_survey',
310 'entity' => 'Survey',
311 'bao' => 'CRM_Campaign_BAO_Survey',
314 'max_number_of_contacts' => array(
315 'name' => 'max_number_of_contacts',
316 'type' => CRM_Utils_Type
::T_INT
,
317 'title' => ts('Maximum number of contacts') ,
318 'description' => 'Maximum number of contacts to allow for survey.',
320 'table_name' => 'civicrm_survey',
321 'entity' => 'Survey',
322 'bao' => 'CRM_Campaign_BAO_Survey',
325 'default_number_of_contacts' => array(
326 'name' => 'default_number_of_contacts',
327 'type' => CRM_Utils_Type
::T_INT
,
328 'title' => ts('Default number of contacts') ,
329 'description' => 'Default number of contacts to allow for survey.',
331 'table_name' => 'civicrm_survey',
332 'entity' => 'Survey',
333 'bao' => 'CRM_Campaign_BAO_Survey',
336 'is_active' => array(
337 'name' => 'is_active',
338 'type' => CRM_Utils_Type
::T_BOOLEAN
,
339 'title' => ts('Survey Is Active') ,
340 'description' => 'Is this survey enabled or disabled/cancelled?',
342 'table_name' => 'civicrm_survey',
343 'entity' => 'Survey',
344 'bao' => 'CRM_Campaign_BAO_Survey',
347 'is_default' => array(
348 'name' => 'is_default',
349 'type' => CRM_Utils_Type
::T_BOOLEAN
,
350 'title' => ts('Is Default Survey') ,
351 'description' => 'Is this default survey?',
352 'table_name' => 'civicrm_survey',
353 'entity' => 'Survey',
354 'bao' => 'CRM_Campaign_BAO_Survey',
357 'created_id' => array(
358 'name' => 'created_id',
359 'type' => CRM_Utils_Type
::T_INT
,
360 'title' => ts('Survey Created By') ,
361 'description' => 'FK to civicrm_contact, who created this Survey.',
362 'table_name' => 'civicrm_survey',
363 'entity' => 'Survey',
364 'bao' => 'CRM_Campaign_BAO_Survey',
366 'FKClassName' => 'CRM_Contact_DAO_Contact',
368 'created_date' => array(
369 'name' => 'created_date',
370 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
371 'title' => ts('Campaign Created Date') ,
372 'description' => 'Date and time that Survey was created.',
373 'table_name' => 'civicrm_survey',
374 'entity' => 'Survey',
375 'bao' => 'CRM_Campaign_BAO_Survey',
378 'last_modified_id' => array(
379 'name' => 'last_modified_id',
380 'type' => CRM_Utils_Type
::T_INT
,
381 'title' => ts('Survey Modified') ,
382 'description' => 'FK to civicrm_contact, who recently edited this Survey.',
383 'table_name' => 'civicrm_survey',
384 'entity' => 'Survey',
385 'bao' => 'CRM_Campaign_BAO_Survey',
387 'FKClassName' => 'CRM_Contact_DAO_Contact',
389 'last_modified_date' => array(
390 'name' => 'last_modified_date',
391 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
392 'title' => ts('Survey Modified On') ,
393 'description' => 'Date and time that Survey was edited last time.',
394 'table_name' => 'civicrm_survey',
395 'entity' => 'Survey',
396 'bao' => 'CRM_Campaign_BAO_Survey',
399 'result_id' => array(
400 'name' => 'result_id',
401 'type' => CRM_Utils_Type
::T_INT
,
402 'title' => ts('Survey Result') ,
403 'description' => 'Used to store option group id.',
405 'table_name' => 'civicrm_survey',
406 'entity' => 'Survey',
407 'bao' => 'CRM_Campaign_BAO_Survey',
410 'bypass_confirm' => array(
411 'name' => 'bypass_confirm',
412 'type' => CRM_Utils_Type
::T_BOOLEAN
,
413 'title' => ts('No Email Verification') ,
414 'description' => 'Bypass the email verification.',
415 'table_name' => 'civicrm_survey',
416 'entity' => 'Survey',
417 'bao' => 'CRM_Campaign_BAO_Survey',
420 'thankyou_title' => array(
421 'name' => 'thankyou_title',
422 'type' => CRM_Utils_Type
::T_STRING
,
423 'title' => ts('Thank-you Title') ,
424 'description' => 'Title for Thank-you page (header title tag, and display at the top of the page).',
426 'size' => CRM_Utils_Type
::HUGE
,
427 'table_name' => 'civicrm_survey',
428 'entity' => 'Survey',
429 'bao' => 'CRM_Campaign_BAO_Survey',
432 'thankyou_text' => array(
433 'name' => 'thankyou_text',
434 'type' => CRM_Utils_Type
::T_TEXT
,
435 'title' => ts('Thank-you Text') ,
436 'description' => 'text and html allowed. displayed above result on success page',
439 'table_name' => 'civicrm_survey',
440 'entity' => 'Survey',
441 'bao' => 'CRM_Campaign_BAO_Survey',
444 'type' => 'TextArea',
448 'name' => 'is_share',
449 'type' => CRM_Utils_Type
::T_BOOLEAN
,
450 'title' => ts('Is shared through social media') ,
451 'description' => 'Can people share the petition through social media?',
453 'table_name' => 'civicrm_survey',
454 'entity' => 'Survey',
455 'bao' => 'CRM_Campaign_BAO_Survey',
459 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
461 return Civi
::$statics[__CLASS__
]['fields'];
464 * Return a mapping from field-name to the corresponding key (as used in fields()).
467 * Array(string $name => string $uniqueName).
469 static function &fieldKeys() {
470 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
471 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
473 return Civi
::$statics[__CLASS__
]['fieldKeys'];
476 * Returns the names of this table
480 static function getTableName() {
481 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
484 * Returns if this table needs to be logged
492 * Returns the list of fields that can be imported
494 * @param bool $prefix
498 static function &import($prefix = false) {
499 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'survey', $prefix, array());
503 * Returns the list of fields that can be exported
505 * @param bool $prefix
509 static function &export($prefix = false) {
510 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'survey', $prefix, array());
514 * Returns the list of indices
516 public static function indices($localize = TRUE) {
518 'UI_activity_type_id' => array(
519 'name' => 'UI_activity_type_id',
521 0 => 'activity_type_id',
523 'localizable' => false,
524 'sig' => 'civicrm_survey::0::activity_type_id',
527 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;