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/Contact/GroupContact.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:3e2deec0ac027dd3b8f9a8410e7db54f)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contact_DAO_GroupContact
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_group_contact';
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 instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
96 * FK to civicrm_contact
102 * status of contact relative to membership in group
108 * Optional location to associate with this membership
114 * Optional email to associate with this membership
122 * @return civicrm_group_contact
124 function __construct() {
125 $this->__table
= 'civicrm_group_contact';
126 parent
::__construct();
129 * Returns foreign keys and entity references
132 * [CRM_Core_Reference_Interface]
134 static function getReferenceColumns() {
135 if (!self
::$_links) {
136 self
::$_links = static ::createReferenceColumns(__CLASS__
);
137 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'group_id', 'civicrm_group', 'id');
138 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
139 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'location_id', 'civicrm_loc_block', 'id');
140 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'email_id', 'civicrm_email', 'id');
142 return self
::$_links;
145 * Returns all the column names of this table
149 static function &fields() {
150 if (!(self
::$_fields)) {
151 self
::$_fields = array(
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Group Contact ID') ,
156 'description' => 'primary key',
160 'name' => 'group_id',
161 'type' => CRM_Utils_Type
::T_INT
,
162 'title' => ts('Group ID') ,
163 'description' => 'FK to civicrm_group',
165 'FKClassName' => 'CRM_Contact_DAO_Group',
169 'pseudoconstant' => array(
170 'table' => 'civicrm_group',
172 'labelColumn' => 'title',
175 'contact_id' => array(
176 'name' => 'contact_id',
177 'type' => CRM_Utils_Type
::T_INT
,
178 'title' => ts('Contact ID') ,
179 'description' => 'FK to civicrm_contact',
181 'FKClassName' => 'CRM_Contact_DAO_Contact',
185 'type' => CRM_Utils_Type
::T_STRING
,
186 'title' => ts('Group Contact Status') ,
187 'description' => 'status of contact relative to membership in group',
189 'size' => CRM_Utils_Type
::EIGHT
,
193 'pseudoconstant' => array(
194 'callback' => 'CRM_Core_SelectValues::groupContactStatus',
197 'location_id' => array(
198 'name' => 'location_id',
199 'type' => CRM_Utils_Type
::T_INT
,
200 'title' => ts('Group Contact Location') ,
201 'description' => 'Optional location to associate with this membership',
202 'FKClassName' => 'CRM_Core_DAO_LocBlock',
205 'name' => 'email_id',
206 'type' => CRM_Utils_Type
::T_INT
,
207 'title' => ts('Group Contact Email') ,
208 'description' => 'Optional email to associate with this membership',
209 'FKClassName' => 'CRM_Core_DAO_Email',
213 return self
::$_fields;
216 * Returns an array containing, for each field, the arary key used for that
217 * field in self::$_fields.
221 static function &fieldKeys() {
222 if (!(self
::$_fieldKeys)) {
223 self
::$_fieldKeys = array(
225 'group_id' => 'group_id',
226 'contact_id' => 'contact_id',
227 'status' => 'status',
228 'location_id' => 'location_id',
229 'email_id' => 'email_id',
232 return self
::$_fieldKeys;
235 * Returns the names of this table
239 static function getTableName() {
240 return self
::$_tableName;
243 * Returns if this table needs to be logged
251 * Returns the list of fields that can be imported
253 * @param bool $prefix
257 static function &import($prefix = false) {
258 if (!(self
::$_import)) {
259 self
::$_import = array();
260 $fields = self
::fields();
261 foreach($fields as $name => $field) {
262 if (CRM_Utils_Array
::value('import', $field)) {
264 self
::$_import['group_contact'] = & $fields[$name];
266 self
::$_import[$name] = & $fields[$name];
271 return self
::$_import;
274 * Returns the list of fields that can be exported
276 * @param bool $prefix
280 static function &export($prefix = false) {
281 if (!(self
::$_export)) {
282 self
::$_export = array();
283 $fields = self
::fields();
284 foreach($fields as $name => $field) {
285 if (CRM_Utils_Array
::value('export', $field)) {
287 self
::$_export['group_contact'] = & $fields[$name];
289 self
::$_export[$name] = & $fields[$name];
294 return self
::$_export;