3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
31 * Generated from xml/schema/CRM/Contact/GroupContact.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:832e42f213ced8c437cc1cb61bdf087f)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Contact_DAO_GroupContact constructor.
40 class CRM_Contact_DAO_GroupContact
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_group_contact';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
66 * FK to civicrm_contact
72 * status of contact relative to membership in group
78 * Optional location to associate with this membership
84 * Optional email to associate with this membership
92 function __construct() {
93 $this->__table
= 'civicrm_group_contact';
94 parent
::__construct();
97 * Returns foreign keys and entity references.
100 * [CRM_Core_Reference_Interface]
102 static function getReferenceColumns() {
103 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
104 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
105 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'group_id', 'civicrm_group', 'id');
106 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contact_id', 'civicrm_contact', 'id');
107 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'location_id', 'civicrm_loc_block', 'id');
108 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'email_id', 'civicrm_email', 'id');
109 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
111 return Civi
::$statics[__CLASS__
]['links'];
114 * Returns all the column names of this table
118 static function &fields() {
119 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
120 Civi
::$statics[__CLASS__
]['fields'] = array(
123 'type' => CRM_Utils_Type
::T_INT
,
124 'title' => ts('Group Contact ID') ,
125 'description' => 'primary key',
127 'table_name' => 'civicrm_group_contact',
128 'entity' => 'GroupContact',
129 'bao' => 'CRM_Contact_BAO_GroupContact',
133 'name' => 'group_id',
134 'type' => CRM_Utils_Type
::T_INT
,
135 'title' => ts('Group ID') ,
136 'description' => 'FK to civicrm_group',
138 'table_name' => 'civicrm_group_contact',
139 'entity' => 'GroupContact',
140 'bao' => 'CRM_Contact_BAO_GroupContact',
142 'FKClassName' => 'CRM_Contact_DAO_Group',
146 'pseudoconstant' => array(
147 'table' => 'civicrm_group',
149 'labelColumn' => 'title',
152 'contact_id' => array(
153 'name' => 'contact_id',
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Contact ID') ,
156 'description' => 'FK to civicrm_contact',
158 'table_name' => 'civicrm_group_contact',
159 'entity' => 'GroupContact',
160 'bao' => 'CRM_Contact_BAO_GroupContact',
162 'FKClassName' => 'CRM_Contact_DAO_Contact',
166 'type' => CRM_Utils_Type
::T_STRING
,
167 'title' => ts('Group Contact Status') ,
168 'description' => 'status of contact relative to membership in group',
170 'size' => CRM_Utils_Type
::EIGHT
,
171 'table_name' => 'civicrm_group_contact',
172 'entity' => 'GroupContact',
173 'bao' => 'CRM_Contact_BAO_GroupContact',
178 'pseudoconstant' => array(
179 'callback' => 'CRM_Core_SelectValues::groupContactStatus',
182 'location_id' => array(
183 'name' => 'location_id',
184 'type' => CRM_Utils_Type
::T_INT
,
185 'title' => ts('Group Contact Location') ,
186 'description' => 'Optional location to associate with this membership',
187 'table_name' => 'civicrm_group_contact',
188 'entity' => 'GroupContact',
189 'bao' => 'CRM_Contact_BAO_GroupContact',
191 'FKClassName' => 'CRM_Core_DAO_LocBlock',
194 'name' => 'email_id',
195 'type' => CRM_Utils_Type
::T_INT
,
196 'title' => ts('Group Contact Email') ,
197 'description' => 'Optional email to associate with this membership',
198 'table_name' => 'civicrm_group_contact',
199 'entity' => 'GroupContact',
200 'bao' => 'CRM_Contact_BAO_GroupContact',
202 'FKClassName' => 'CRM_Core_DAO_Email',
205 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
207 return Civi
::$statics[__CLASS__
]['fields'];
210 * Return a mapping from field-name to the corresponding key (as used in fields()).
213 * Array(string $name => string $uniqueName).
215 static function &fieldKeys() {
216 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
217 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
219 return Civi
::$statics[__CLASS__
]['fieldKeys'];
222 * Returns the names of this table
226 static function getTableName() {
227 return self
::$_tableName;
230 * Returns if this table needs to be logged
238 * Returns the list of fields that can be imported
240 * @param bool $prefix
244 static function &import($prefix = false) {
245 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'group_contact', $prefix, array());
249 * Returns the list of fields that can be exported
251 * @param bool $prefix
255 static function &export($prefix = false) {
256 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'group_contact', $prefix, array());