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:679a5d513b09d5a9a945b81aa00bd4d8)
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 value to see if we should log any modifications to
46 * this table in the civicrm_log table
64 * FK to civicrm_contact
70 * status of contact relative to membership in group
76 * Optional location to associate with this membership
82 * Optional email to associate with this membership
90 * @return civicrm_group_contact
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',
129 'name' => 'group_id',
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Group ID') ,
132 'description' => 'FK to civicrm_group',
134 'FKClassName' => 'CRM_Contact_DAO_Group',
138 'pseudoconstant' => array(
139 'table' => 'civicrm_group',
141 'labelColumn' => 'title',
144 'contact_id' => array(
145 'name' => 'contact_id',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Contact ID') ,
148 'description' => 'FK to civicrm_contact',
150 'FKClassName' => 'CRM_Contact_DAO_Contact',
154 'type' => CRM_Utils_Type
::T_STRING
,
155 'title' => ts('Group Contact Status') ,
156 'description' => 'status of contact relative to membership in group',
158 'size' => CRM_Utils_Type
::EIGHT
,
162 'pseudoconstant' => array(
163 'callback' => 'CRM_Core_SelectValues::groupContactStatus',
166 'location_id' => array(
167 'name' => 'location_id',
168 'type' => CRM_Utils_Type
::T_INT
,
169 'title' => ts('Group Contact Location') ,
170 'description' => 'Optional location to associate with this membership',
171 'FKClassName' => 'CRM_Core_DAO_LocBlock',
174 'name' => 'email_id',
175 'type' => CRM_Utils_Type
::T_INT
,
176 'title' => ts('Group Contact Email') ,
177 'description' => 'Optional email to associate with this membership',
178 'FKClassName' => 'CRM_Core_DAO_Email',
181 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
183 return Civi
::$statics[__CLASS__
]['fields'];
186 * Return a mapping from field-name to the corresponding key (as used in fields()).
189 * Array(string $name => string $uniqueName).
191 static function &fieldKeys() {
192 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
193 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
195 return Civi
::$statics[__CLASS__
]['fieldKeys'];
198 * Returns the names of this table
202 static function getTableName() {
203 return self
::$_tableName;
206 * Returns if this table needs to be logged
214 * Returns the list of fields that can be imported
216 * @param bool $prefix
220 static function &import($prefix = false) {
221 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'group_contact', $prefix, array());
225 * Returns the list of fields that can be exported
227 * @param bool $prefix
231 static function &export($prefix = false) {
232 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'group_contact', $prefix, array());