3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
31 * Generated from xml/schema/CRM/Report/ReportInstance.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Report_DAO_ReportInstance
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_report_instance';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
89 * Which Domain is this instance for
95 * Report Instance Title.
101 * FK to civicrm_option_value for the report template
107 * when combined with report_id/template uniquely identifies the instance
113 * arguments that are passed in the url when invoking the instance
119 * Report Instance description.
125 * permission required to be able to run this instance
131 * role required to be able to run this instance
137 * Submitted form values for this report
143 * Is this entry active?
149 * FK to contact table.
155 * FK to contact table.
165 public $email_subject;
167 * comma-separated list of email addresses to send the report to
173 * comma-separated list of email addresses to send the report to
179 * comma-separated list of email addresses to send the report to
185 * comma-separated list of email addresses to send the report to
191 * FK to navigation ID
195 public $navigation_id;
197 * FK to instance ID drilldown to
201 public $drilldown_id;
210 * @return civicrm_report_instance
212 function __construct() {
213 $this->__table
= 'civicrm_report_instance';
214 parent
::__construct();
217 * Returns foreign keys and entity references
220 * [CRM_Core_Reference_Interface]
222 static function getReferenceColumns() {
223 if (!self
::$_links) {
224 self
::$_links = static ::createReferenceColumns(__CLASS__
);
225 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
226 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
227 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'owner_id', 'civicrm_contact', 'id');
228 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'navigation_id', 'civicrm_navigation', 'id');
229 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'drilldown_id', 'civicrm_report_instance', 'id');
231 return self
::$_links;
234 * Returns all the column names of this table
238 static function &fields() {
239 if (!(self
::$_fields)) {
240 self
::$_fields = array(
243 'type' => CRM_Utils_Type
::T_INT
,
244 'title' => ts('Report Instance ID') ,
245 'description' => 'Report Instance ID',
248 'domain_id' => array(
249 'name' => 'domain_id',
250 'type' => CRM_Utils_Type
::T_INT
,
251 'title' => ts('Report Instance Domain ID') ,
252 'description' => 'Which Domain is this instance for',
254 'FKClassName' => 'CRM_Core_DAO_Domain',
255 'pseudoconstant' => array(
256 'table' => 'civicrm_domain',
258 'labelColumn' => 'name',
263 'type' => CRM_Utils_Type
::T_STRING
,
264 'title' => ts('Report Instance Title') ,
265 'description' => 'Report Instance Title.',
267 'size' => CRM_Utils_Type
::HUGE
,
272 'report_id' => array(
273 'name' => 'report_id',
274 'type' => CRM_Utils_Type
::T_STRING
,
275 'title' => ts('Report template ID') ,
276 'description' => 'FK to civicrm_option_value for the report template',
279 'size' => CRM_Utils_Type
::BIG
,
286 'type' => CRM_Utils_Type
::T_STRING
,
287 'title' => ts('Report instance Name') ,
288 'description' => 'when combined with report_id/template uniquely identifies the instance',
290 'size' => CRM_Utils_Type
::HUGE
,
297 'type' => CRM_Utils_Type
::T_STRING
,
298 'title' => ts('Report Instance Arguments') ,
299 'description' => 'arguments that are passed in the url when invoking the instance',
301 'size' => CRM_Utils_Type
::HUGE
,
306 'description' => array(
307 'name' => 'description',
308 'type' => CRM_Utils_Type
::T_STRING
,
309 'title' => ts('Report Instance description') ,
310 'description' => 'Report Instance description.',
312 'size' => CRM_Utils_Type
::HUGE
,
317 'permission' => array(
318 'name' => 'permission',
319 'type' => CRM_Utils_Type
::T_STRING
,
320 'title' => ts('Report Instance Permissions') ,
321 'description' => 'permission required to be able to run this instance',
323 'size' => CRM_Utils_Type
::HUGE
,
328 'grouprole' => array(
329 'name' => 'grouprole',
330 'type' => CRM_Utils_Type
::T_STRING
,
331 'title' => ts('Report Instance Assigned to Roles') ,
332 'description' => 'role required to be able to run this instance',
334 'size' => CRM_Utils_Type
::HUGE
,
339 'form_values' => array(
340 'name' => 'form_values',
341 'type' => CRM_Utils_Type
::T_TEXT
,
342 'title' => ts('Submitted Form Values') ,
343 'description' => 'Submitted form values for this report',
345 'where' => 'civicrm_report_instance.form_values',
346 'headerPattern' => '',
350 'is_active' => array(
351 'name' => 'is_active',
352 'type' => CRM_Utils_Type
::T_BOOLEAN
,
353 'title' => ts('Report Instance is Active') ,
354 'description' => 'Is this entry active?',
356 'type' => 'CheckBox',
359 'created_id' => array(
360 'name' => 'created_id',
361 'type' => CRM_Utils_Type
::T_INT
,
362 'title' => ts('Report Instance Created By') ,
363 'description' => 'FK to contact table.',
364 'FKClassName' => 'CRM_Contact_DAO_Contact',
367 'name' => 'owner_id',
368 'type' => CRM_Utils_Type
::T_INT
,
369 'title' => ts('Report Instance Owned By') ,
370 'description' => 'FK to contact table.',
371 'FKClassName' => 'CRM_Contact_DAO_Contact',
373 'email_subject' => array(
374 'name' => 'email_subject',
375 'type' => CRM_Utils_Type
::T_STRING
,
376 'title' => ts('Report Instance email Subject') ,
377 'description' => 'Subject of email',
379 'size' => CRM_Utils_Type
::HUGE
,
385 'name' => 'email_to',
386 'type' => CRM_Utils_Type
::T_TEXT
,
387 'title' => ts('Email Report Instance To') ,
388 'description' => 'comma-separated list of email addresses to send the report to',
394 'name' => 'email_cc',
395 'type' => CRM_Utils_Type
::T_TEXT
,
396 'title' => ts('cc Email Report Instance To') ,
397 'description' => 'comma-separated list of email addresses to send the report to',
404 'type' => CRM_Utils_Type
::T_TEXT
,
405 'title' => ts('Report Instance Header') ,
406 'description' => 'comma-separated list of email addresses to send the report to',
410 'type' => 'TextArea',
415 'type' => CRM_Utils_Type
::T_TEXT
,
416 'title' => ts('Report Instance Footer') ,
417 'description' => 'comma-separated list of email addresses to send the report to',
421 'type' => 'TextArea',
424 'navigation_id' => array(
425 'name' => 'navigation_id',
426 'type' => CRM_Utils_Type
::T_INT
,
427 'title' => ts('Navigation ID') ,
428 'description' => 'FK to navigation ID',
430 'where' => 'civicrm_report_instance.navigation_id',
431 'headerPattern' => '',
434 'FKClassName' => 'CRM_Core_DAO_Navigation',
436 'drilldown_id' => array(
437 'name' => 'drilldown_id',
438 'type' => CRM_Utils_Type
::T_INT
,
439 'title' => ts('Drilldown Report ID') ,
440 'description' => 'FK to instance ID drilldown to',
442 'where' => 'civicrm_report_instance.drilldown_id',
443 'headerPattern' => '',
446 'FKClassName' => 'CRM_Report_DAO_ReportInstance',
448 'is_reserved' => array(
449 'name' => 'is_reserved',
450 'type' => CRM_Utils_Type
::T_BOOLEAN
,
451 'title' => ts('Instance is Reserved') ,
453 'type' => 'CheckBox',
458 return self
::$_fields;
461 * Returns an array containing, for each field, the arary key used for that
462 * field in self::$_fields.
466 static function &fieldKeys() {
467 if (!(self
::$_fieldKeys)) {
468 self
::$_fieldKeys = array(
470 'domain_id' => 'domain_id',
472 'report_id' => 'report_id',
475 'description' => 'description',
476 'permission' => 'permission',
477 'grouprole' => 'grouprole',
478 'form_values' => 'form_values',
479 'is_active' => 'is_active',
480 'created_id' => 'created_id',
481 'owner_id' => 'owner_id',
482 'email_subject' => 'email_subject',
483 'email_to' => 'email_to',
484 'email_cc' => 'email_cc',
485 'header' => 'header',
486 'footer' => 'footer',
487 'navigation_id' => 'navigation_id',
488 'drilldown_id' => 'drilldown_id',
489 'is_reserved' => 'is_reserved',
492 return self
::$_fieldKeys;
495 * Returns the names of this table
499 static function getTableName() {
500 return self
::$_tableName;
503 * Returns if this table needs to be logged
511 * Returns the list of fields that can be imported
513 * @param bool $prefix
517 static function &import($prefix = false) {
518 if (!(self
::$_import)) {
519 self
::$_import = array();
520 $fields = self
::fields();
521 foreach($fields as $name => $field) {
522 if (CRM_Utils_Array
::value('import', $field)) {
524 self
::$_import['report_instance'] = & $fields[$name];
526 self
::$_import[$name] = & $fields[$name];
531 return self
::$_import;
534 * Returns the list of fields that can be exported
536 * @param bool $prefix
540 static function &export($prefix = false) {
541 if (!(self
::$_export)) {
542 self
::$_export = array();
543 $fields = self
::fields();
544 foreach($fields as $name => $field) {
545 if (CRM_Utils_Array
::value('export', $field)) {
547 self
::$_export['report_instance'] = & $fields[$name];
549 self
::$_export[$name] = & $fields[$name];
554 return self
::$_export;