commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / CRM / Activity / DAO / ActivityContact.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2015
30 *
31 * Generated from xml/schema/CRM/Activity/ActivityContact.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 */
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Activity_DAO_ActivityContact extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_activity_contact';
43 /**
44 * static instance to hold the field values
45 *
46 * @var array
47 */
48 static $_fields = null;
49 /**
50 * static instance to hold the keys used in $_fields for each field.
51 *
52 * @var array
53 */
54 static $_fieldKeys = null;
55 /**
56 * static instance to hold the FK relationships
57 *
58 * @var string
59 */
60 static $_links = null;
61 /**
62 * static instance to hold the values that can
63 * be imported
64 *
65 * @var array
66 */
67 static $_import = null;
68 /**
69 * static instance to hold the values that can
70 * be exported
71 *
72 * @var array
73 */
74 static $_export = null;
75 /**
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
78 *
79 * @var boolean
80 */
81 static $_log = true;
82 /**
83 * Activity contact id
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Foreign key to the activity for this record.
90 *
91 * @var int unsigned
92 */
93 public $activity_id;
94 /**
95 * Foreign key to the contact for this record.
96 *
97 * @var int unsigned
98 */
99 public $contact_id;
100 /**
101 * Nature of this contact's role in the activity: 1 assignee, 2 creator, 3 focus or target.
102 *
103 * @var int unsigned
104 */
105 public $record_type_id;
106 /**
107 * class constructor
108 *
109 * @return civicrm_activity_contact
110 */
111 function __construct() {
112 $this->__table = 'civicrm_activity_contact';
113 parent::__construct();
114 }
115 /**
116 * Returns foreign keys and entity references
117 *
118 * @return array
119 * [CRM_Core_Reference_Interface]
120 */
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');
126 }
127 return self::$_links;
128 }
129 /**
130 * Returns all the column names of this table
131 *
132 * @return array
133 */
134 static function &fields() {
135 if (!(self::$_fields)) {
136 self::$_fields = array(
137 'id' => array(
138 'name' => 'id',
139 'type' => CRM_Utils_Type::T_INT,
140 'title' => ts('Activity Contact ID') ,
141 'description' => 'Activity contact id',
142 'required' => true,
143 ) ,
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.',
149 'required' => true,
150 'FKClassName' => 'CRM_Activity_DAO_Activity',
151 ) ,
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.',
157 'required' => true,
158 'import' => true,
159 'where' => 'civicrm_activity_contact.contact_id',
160 'headerPattern' => '',
161 'dataPattern' => '',
162 'export' => true,
163 'FKClassName' => 'CRM_Contact_DAO_Contact',
164 ) ,
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.',
170 'html' => array(
171 'type' => 'Select',
172 ) ,
173 'pseudoconstant' => array(
174 'optionGroupName' => 'activity_contacts',
175 'optionEditPath' => 'civicrm/admin/options/activity_contacts',
176 )
177 ) ,
178 );
179 }
180 return self::$_fields;
181 }
182 /**
183 * Returns an array containing, for each field, the arary key used for that
184 * field in self::$_fields.
185 *
186 * @return array
187 */
188 static function &fieldKeys() {
189 if (!(self::$_fieldKeys)) {
190 self::$_fieldKeys = array(
191 'id' => 'id',
192 'activity_id' => 'activity_id',
193 'contact_id' => 'contact_id',
194 'record_type_id' => 'record_type_id',
195 );
196 }
197 return self::$_fieldKeys;
198 }
199 /**
200 * Returns the names of this table
201 *
202 * @return string
203 */
204 static function getTableName() {
205 return self::$_tableName;
206 }
207 /**
208 * Returns if this table needs to be logged
209 *
210 * @return boolean
211 */
212 function getLog() {
213 return self::$_log;
214 }
215 /**
216 * Returns the list of fields that can be imported
217 *
218 * @param bool $prefix
219 *
220 * @return array
221 */
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)) {
228 if ($prefix) {
229 self::$_import['activity_contact'] = & $fields[$name];
230 } else {
231 self::$_import[$name] = & $fields[$name];
232 }
233 }
234 }
235 }
236 return self::$_import;
237 }
238 /**
239 * Returns the list of fields that can be exported
240 *
241 * @param bool $prefix
242 *
243 * @return array
244 */
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)) {
251 if ($prefix) {
252 self::$_export['activity_contact'] = & $fields[$name];
253 } else {
254 self::$_export[$name] = & $fields[$name];
255 }
256 }
257 }
258 }
259 return self::$_export;
260 }
261 }