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/Activity/ActivityContact.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_Activity_DAO_ActivityContact
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_activity_contact';
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 * Foreign key to the activity for this record.
95 * Foreign key to the contact for this record.
101 * Nature of this contact's role in the activity: 1 assignee, 2 creator, 3 focus or target.
105 public $record_type_id;
109 * @return civicrm_activity_contact
111 function __construct() {
112 $this->__table
= 'civicrm_activity_contact';
113 parent
::__construct();
116 * Returns foreign keys and entity references
119 * [CRM_Core_Reference_Interface]
121 static function getReferenceColumns() {
122 if (!self
::$_links) {
123 self
::$_links = static ::createReferenceColumns(__CLASS__
);
124 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'activity_id', 'civicrm_activity', 'id');
125 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
127 return self
::$_links;
130 * Returns all the column names of this table
134 static function &fields() {
135 if (!(self
::$_fields)) {
136 self
::$_fields = array(
139 'type' => CRM_Utils_Type
::T_INT
,
140 'title' => ts('Activity Contact ID') ,
141 'description' => 'Activity contact id',
144 'activity_id' => array(
145 'name' => 'activity_id',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Activity ID') ,
148 'description' => 'Foreign key to the activity for this record.',
150 'FKClassName' => 'CRM_Activity_DAO_Activity',
152 'contact_id' => array(
153 'name' => 'contact_id',
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Contact ID (match to contact)') ,
156 'description' => 'Foreign key to the contact for this record.',
159 'where' => 'civicrm_activity_contact.contact_id',
160 'headerPattern' => '',
163 'FKClassName' => 'CRM_Contact_DAO_Contact',
165 'record_type_id' => array(
166 'name' => 'record_type_id',
167 'type' => CRM_Utils_Type
::T_INT
,
168 'title' => ts('Record Type ID') ,
169 'description' => 'Nature of this contact\'s role in the activity: 1 assignee, 2 creator, 3 focus or target.',
173 'pseudoconstant' => array(
174 'optionGroupName' => 'activity_contacts',
175 'optionEditPath' => 'civicrm/admin/options/activity_contacts',
180 return self
::$_fields;
183 * Returns an array containing, for each field, the arary key used for that
184 * field in self::$_fields.
188 static function &fieldKeys() {
189 if (!(self
::$_fieldKeys)) {
190 self
::$_fieldKeys = array(
192 'activity_id' => 'activity_id',
193 'contact_id' => 'contact_id',
194 'record_type_id' => 'record_type_id',
197 return self
::$_fieldKeys;
200 * Returns the names of this table
204 static function getTableName() {
205 return self
::$_tableName;
208 * Returns if this table needs to be logged
216 * Returns the list of fields that can be imported
218 * @param bool $prefix
222 static function &import($prefix = false) {
223 if (!(self
::$_import)) {
224 self
::$_import = array();
225 $fields = self
::fields();
226 foreach($fields as $name => $field) {
227 if (CRM_Utils_Array
::value('import', $field)) {
229 self
::$_import['activity_contact'] = & $fields[$name];
231 self
::$_import[$name] = & $fields[$name];
236 return self
::$_import;
239 * Returns the list of fields that can be exported
241 * @param bool $prefix
245 static function &export($prefix = false) {
246 if (!(self
::$_export)) {
247 self
::$_export = array();
248 $fields = self
::fields();
249 foreach($fields as $name => $field) {
250 if (CRM_Utils_Array
::value('export', $field)) {
252 self
::$_export['activity_contact'] = & $fields[$name];
254 self
::$_export[$name] = & $fields[$name];
259 return self
::$_export;