3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Campaign/Survey.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:c45e190f503b80f0ee057a9ed43a5753)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Campaign_DAO_Survey
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_survey';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static value to see if we should log any modifications to
64 * this table in the civicrm_log table
76 * Title of the Survey.
82 * Foreign key to the Campaign.
88 * Implicit FK to civicrm_option_value where option_group = activity_type
92 public $activity_type_id;
94 * Recontact intervals for each status.
98 public $recontact_interval;
100 * Script instructions for volunteers to use for the survey.
104 public $instructions;
106 * Number of days for recurrence of release.
110 public $release_frequency;
112 * Maximum number of contacts to allow for survey.
116 public $max_number_of_contacts;
118 * Default number of contacts to allow for survey.
122 public $default_number_of_contacts;
124 * Is this survey enabled or disabled/cancelled?
130 * Is this default survey?
136 * FK to civicrm_contact, who created this Survey.
142 * Date and time that Survey was created.
146 public $created_date;
148 * FK to civicrm_contact, who recently edited this Survey.
152 public $last_modified_id;
154 * Date and time that Survey was edited last time.
158 public $last_modified_date;
160 * Used to store option group id.
166 * Bypass the email verification.
170 public $bypass_confirm;
172 * Title for Thank-you page (header title tag, and display at the top of the page).
176 public $thankyou_title;
178 * text and html allowed. displayed above result on success page
182 public $thankyou_text;
184 * Can people share the petition through social media?
192 * @return civicrm_survey
194 function __construct() {
195 $this->__table
= 'civicrm_survey';
196 parent
::__construct();
199 * Returns foreign keys and entity references
202 * [CRM_Core_Reference_Interface]
204 static function getReferenceColumns() {
205 if (!self
::$_links) {
206 self
::$_links = static ::createReferenceColumns(__CLASS__
);
207 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'campaign_id', 'civicrm_campaign', 'id');
208 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
209 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'last_modified_id', 'civicrm_contact', 'id');
211 return self
::$_links;
214 * Returns all the column names of this table
218 static function &fields() {
219 if (!(self
::$_fields)) {
220 self
::$_fields = array(
223 'type' => CRM_Utils_Type
::T_INT
,
224 'title' => ts('Survey ID') ,
225 'description' => 'Survey id.',
230 'type' => CRM_Utils_Type
::T_STRING
,
231 'title' => ts('Survey Title') ,
232 'description' => 'Title of the Survey.',
235 'size' => CRM_Utils_Type
::HUGE
,
237 'where' => 'civicrm_survey.title',
238 'headerPattern' => '',
242 'campaign_id' => array(
243 'name' => 'campaign_id',
244 'type' => CRM_Utils_Type
::T_INT
,
245 'title' => ts('Survey Campaign ID') ,
246 'description' => 'Foreign key to the Campaign.',
248 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
249 'pseudoconstant' => array(
250 'table' => 'civicrm_campaign',
252 'labelColumn' => 'title',
255 'activity_type_id' => array(
256 'name' => 'activity_type_id',
257 'type' => CRM_Utils_Type
::T_INT
,
258 'title' => ts('Activity Type') ,
259 'description' => 'Implicit FK to civicrm_option_value where option_group = activity_type',
261 'where' => 'civicrm_survey.activity_type_id',
262 'headerPattern' => '',
269 'pseudoconstant' => array(
270 'optionGroupName' => 'activity_type',
271 'optionEditPath' => 'civicrm/admin/options/activity_type',
274 'recontact_interval' => array(
275 'name' => 'recontact_interval',
276 'type' => CRM_Utils_Type
::T_TEXT
,
277 'title' => ts('Follow up Interval') ,
278 'description' => 'Recontact intervals for each status.',
282 'type' => 'TextArea',
285 'instructions' => array(
286 'name' => 'instructions',
287 'type' => CRM_Utils_Type
::T_TEXT
,
288 'title' => ts('Instructions') ,
289 'description' => 'Script instructions for volunteers to use for the survey.',
293 'type' => 'TextArea',
296 'release_frequency' => array(
297 'name' => 'release_frequency',
298 'type' => CRM_Utils_Type
::T_INT
,
299 'title' => ts('Survey Hold Duration') ,
300 'description' => 'Number of days for recurrence of release.',
303 'max_number_of_contacts' => array(
304 'name' => 'max_number_of_contacts',
305 'type' => CRM_Utils_Type
::T_INT
,
306 'title' => ts('Maximum number of contacts') ,
307 'description' => 'Maximum number of contacts to allow for survey.',
310 'default_number_of_contacts' => array(
311 'name' => 'default_number_of_contacts',
312 'type' => CRM_Utils_Type
::T_INT
,
313 'title' => ts('Default number of contacts') ,
314 'description' => 'Default number of contacts to allow for survey.',
317 'is_active' => array(
318 'name' => 'is_active',
319 'type' => CRM_Utils_Type
::T_BOOLEAN
,
320 'title' => ts('Survey Is Active') ,
321 'description' => 'Is this survey enabled or disabled/cancelled?',
324 'is_default' => array(
325 'name' => 'is_default',
326 'type' => CRM_Utils_Type
::T_BOOLEAN
,
327 'title' => ts('Is Default Survey') ,
328 'description' => 'Is this default survey?',
330 'created_id' => array(
331 'name' => 'created_id',
332 'type' => CRM_Utils_Type
::T_INT
,
333 'title' => ts('Survey Created By') ,
334 'description' => 'FK to civicrm_contact, who created this Survey.',
335 'FKClassName' => 'CRM_Contact_DAO_Contact',
337 'created_date' => array(
338 'name' => 'created_date',
339 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
340 'title' => ts('Campaign Created Date') ,
341 'description' => 'Date and time that Survey was created.',
343 'last_modified_id' => array(
344 'name' => 'last_modified_id',
345 'type' => CRM_Utils_Type
::T_INT
,
346 'title' => ts('Survey Modified') ,
347 'description' => 'FK to civicrm_contact, who recently edited this Survey.',
348 'FKClassName' => 'CRM_Contact_DAO_Contact',
350 'last_modified_date' => array(
351 'name' => 'last_modified_date',
352 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
353 'title' => ts('Survey Modified On') ,
354 'description' => 'Date and time that Survey was edited last time.',
356 'result_id' => array(
357 'name' => 'result_id',
358 'type' => CRM_Utils_Type
::T_INT
,
359 'title' => ts('Survey Result') ,
360 'description' => 'Used to store option group id.',
363 'bypass_confirm' => array(
364 'name' => 'bypass_confirm',
365 'type' => CRM_Utils_Type
::T_BOOLEAN
,
366 'title' => ts('No Email Verification') ,
367 'description' => 'Bypass the email verification.',
369 'thankyou_title' => array(
370 'name' => 'thankyou_title',
371 'type' => CRM_Utils_Type
::T_STRING
,
372 'title' => ts('Thank-you Title') ,
373 'description' => 'Title for Thank-you page (header title tag, and display at the top of the page).',
375 'size' => CRM_Utils_Type
::HUGE
,
377 'thankyou_text' => array(
378 'name' => 'thankyou_text',
379 'type' => CRM_Utils_Type
::T_TEXT
,
380 'title' => ts('Thank-you Text') ,
381 'description' => 'text and html allowed. displayed above result on success page',
385 'type' => 'TextArea',
389 'name' => 'is_share',
390 'type' => CRM_Utils_Type
::T_BOOLEAN
,
391 'title' => ts('Is shared through social media') ,
392 'description' => 'Can people share the petition through social media?',
397 return self
::$_fields;
400 * Returns an array containing, for each field, the arary key used for that
401 * field in self::$_fields.
405 static function &fieldKeys() {
406 if (!(self
::$_fieldKeys)) {
407 self
::$_fieldKeys = array(
410 'campaign_id' => 'campaign_id',
411 'activity_type_id' => 'activity_type_id',
412 'recontact_interval' => 'recontact_interval',
413 'instructions' => 'instructions',
414 'release_frequency' => 'release_frequency',
415 'max_number_of_contacts' => 'max_number_of_contacts',
416 'default_number_of_contacts' => 'default_number_of_contacts',
417 'is_active' => 'is_active',
418 'is_default' => 'is_default',
419 'created_id' => 'created_id',
420 'created_date' => 'created_date',
421 'last_modified_id' => 'last_modified_id',
422 'last_modified_date' => 'last_modified_date',
423 'result_id' => 'result_id',
424 'bypass_confirm' => 'bypass_confirm',
425 'thankyou_title' => 'thankyou_title',
426 'thankyou_text' => 'thankyou_text',
427 'is_share' => 'is_share',
430 return self
::$_fieldKeys;
433 * Returns the names of this table
437 static function getTableName() {
438 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
441 * Returns if this table needs to be logged
449 * Returns the list of fields that can be imported
451 * @param bool $prefix
455 static function &import($prefix = false) {
456 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'survey', $prefix, array());
460 * Returns the list of fields that can be exported
462 * @param bool $prefix
466 static function &export($prefix = false) {
467 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'survey', $prefix, array());