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 value to see if we should log any modifications to
46 * this table in the civicrm_log table
58 * Title of the Survey.
64 * Foreign key to the Campaign.
70 * Implicit FK to civicrm_option_value where option_group = activity_type
74 public $activity_type_id;
76 * Recontact intervals for each status.
80 public $recontact_interval;
82 * Script instructions for volunteers to use for the survey.
88 * Number of days for recurrence of release.
92 public $release_frequency;
94 * Maximum number of contacts to allow for survey.
98 public $max_number_of_contacts;
100 * Default number of contacts to allow for survey.
104 public $default_number_of_contacts;
106 * Is this survey enabled or disabled/cancelled?
112 * Is this default survey?
118 * FK to civicrm_contact, who created this Survey.
124 * Date and time that Survey was created.
128 public $created_date;
130 * FK to civicrm_contact, who recently edited this Survey.
134 public $last_modified_id;
136 * Date and time that Survey was edited last time.
140 public $last_modified_date;
142 * Used to store option group id.
148 * Bypass the email verification.
152 public $bypass_confirm;
154 * Title for Thank-you page (header title tag, and display at the top of the page).
158 public $thankyou_title;
160 * text and html allowed. displayed above result on success page
164 public $thankyou_text;
166 * Can people share the petition through social media?
174 * @return civicrm_survey
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.',
213 'type' => CRM_Utils_Type
::T_STRING
,
214 'title' => ts('Survey Title') ,
215 'description' => 'Title of the Survey.',
218 'size' => CRM_Utils_Type
::HUGE
,
220 'where' => 'civicrm_survey.title',
221 'headerPattern' => '',
225 'campaign_id' => array(
226 'name' => 'campaign_id',
227 'type' => CRM_Utils_Type
::T_INT
,
228 'title' => ts('Survey Campaign ID') ,
229 'description' => 'Foreign key to the Campaign.',
231 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
232 'pseudoconstant' => array(
233 'table' => 'civicrm_campaign',
235 'labelColumn' => 'title',
238 'activity_type_id' => array(
239 'name' => 'activity_type_id',
240 'type' => CRM_Utils_Type
::T_INT
,
241 'title' => ts('Activity Type') ,
242 'description' => 'Implicit FK to civicrm_option_value where option_group = activity_type',
244 'where' => 'civicrm_survey.activity_type_id',
245 'headerPattern' => '',
252 'pseudoconstant' => array(
253 'optionGroupName' => 'activity_type',
254 'optionEditPath' => 'civicrm/admin/options/activity_type',
257 'recontact_interval' => array(
258 'name' => 'recontact_interval',
259 'type' => CRM_Utils_Type
::T_TEXT
,
260 'title' => ts('Follow up Interval') ,
261 'description' => 'Recontact intervals for each status.',
265 'type' => 'TextArea',
268 'instructions' => array(
269 'name' => 'instructions',
270 'type' => CRM_Utils_Type
::T_TEXT
,
271 'title' => ts('Instructions') ,
272 'description' => 'Script instructions for volunteers to use for the survey.',
276 'type' => 'TextArea',
279 'release_frequency' => array(
280 'name' => 'release_frequency',
281 'type' => CRM_Utils_Type
::T_INT
,
282 'title' => ts('Survey Hold Duration') ,
283 'description' => 'Number of days for recurrence of release.',
286 'max_number_of_contacts' => array(
287 'name' => 'max_number_of_contacts',
288 'type' => CRM_Utils_Type
::T_INT
,
289 'title' => ts('Maximum number of contacts') ,
290 'description' => 'Maximum number of contacts to allow for survey.',
293 'default_number_of_contacts' => array(
294 'name' => 'default_number_of_contacts',
295 'type' => CRM_Utils_Type
::T_INT
,
296 'title' => ts('Default number of contacts') ,
297 'description' => 'Default number of contacts to allow for survey.',
300 'is_active' => array(
301 'name' => 'is_active',
302 'type' => CRM_Utils_Type
::T_BOOLEAN
,
303 'title' => ts('Survey Is Active') ,
304 'description' => 'Is this survey enabled or disabled/cancelled?',
307 'is_default' => array(
308 'name' => 'is_default',
309 'type' => CRM_Utils_Type
::T_BOOLEAN
,
310 'title' => ts('Is Default Survey') ,
311 'description' => 'Is this default survey?',
313 'created_id' => array(
314 'name' => 'created_id',
315 'type' => CRM_Utils_Type
::T_INT
,
316 'title' => ts('Survey Created By') ,
317 'description' => 'FK to civicrm_contact, who created this Survey.',
318 'FKClassName' => 'CRM_Contact_DAO_Contact',
320 'created_date' => array(
321 'name' => 'created_date',
322 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
323 'title' => ts('Campaign Created Date') ,
324 'description' => 'Date and time that Survey was created.',
326 'last_modified_id' => array(
327 'name' => 'last_modified_id',
328 'type' => CRM_Utils_Type
::T_INT
,
329 'title' => ts('Survey Modified') ,
330 'description' => 'FK to civicrm_contact, who recently edited this Survey.',
331 'FKClassName' => 'CRM_Contact_DAO_Contact',
333 'last_modified_date' => array(
334 'name' => 'last_modified_date',
335 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
336 'title' => ts('Survey Modified On') ,
337 'description' => 'Date and time that Survey was edited last time.',
339 'result_id' => array(
340 'name' => 'result_id',
341 'type' => CRM_Utils_Type
::T_INT
,
342 'title' => ts('Survey Result') ,
343 'description' => 'Used to store option group id.',
346 'bypass_confirm' => array(
347 'name' => 'bypass_confirm',
348 'type' => CRM_Utils_Type
::T_BOOLEAN
,
349 'title' => ts('No Email Verification') ,
350 'description' => 'Bypass the email verification.',
352 'thankyou_title' => array(
353 'name' => 'thankyou_title',
354 'type' => CRM_Utils_Type
::T_STRING
,
355 'title' => ts('Thank-you Title') ,
356 'description' => 'Title for Thank-you page (header title tag, and display at the top of the page).',
358 'size' => CRM_Utils_Type
::HUGE
,
360 'thankyou_text' => array(
361 'name' => 'thankyou_text',
362 'type' => CRM_Utils_Type
::T_TEXT
,
363 'title' => ts('Thank-you Text') ,
364 'description' => 'text and html allowed. displayed above result on success page',
368 'type' => 'TextArea',
372 'name' => 'is_share',
373 'type' => CRM_Utils_Type
::T_BOOLEAN
,
374 'title' => ts('Is shared through social media') ,
375 'description' => 'Can people share the petition through social media?',
379 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
381 return Civi
::$statics[__CLASS__
]['fields'];
384 * Return a mapping from field-name to the corresponding key (as used in fields()).
387 * Array(string $name => string $uniqueName).
389 static function &fieldKeys() {
390 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
391 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
393 return Civi
::$statics[__CLASS__
]['fieldKeys'];
396 * Returns the names of this table
400 static function getTableName() {
401 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
404 * Returns if this table needs to be logged
412 * Returns the list of fields that can be imported
414 * @param bool $prefix
418 static function &import($prefix = false) {
419 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'survey', $prefix, array());
423 * Returns the list of fields that can be exported
425 * @param bool $prefix
429 static function &export($prefix = false) {
430 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'survey', $prefix, array());