CRM-20312 regenerated DAO with localisation
[civicrm-core.git] / CRM / Contact / DAO / GroupContact.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
30 *
31 * Generated from xml/schema/CRM/Contact/GroupContact.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:832e42f213ced8c437cc1cb61bdf087f)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Contact_DAO_GroupContact constructor.
39 */
40 class CRM_Contact_DAO_GroupContact extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_group_contact';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = true;
53 /**
54 * primary key
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * FK to civicrm_group
61 *
62 * @var int unsigned
63 */
64 public $group_id;
65 /**
66 * FK to civicrm_contact
67 *
68 * @var int unsigned
69 */
70 public $contact_id;
71 /**
72 * status of contact relative to membership in group
73 *
74 * @var string
75 */
76 public $status;
77 /**
78 * Optional location to associate with this membership
79 *
80 * @var int unsigned
81 */
82 public $location_id;
83 /**
84 * Optional email to associate with this membership
85 *
86 * @var int unsigned
87 */
88 public $email_id;
89 /**
90 * Class constructor.
91 */
92 function __construct() {
93 $this->__table = 'civicrm_group_contact';
94 parent::__construct();
95 }
96 /**
97 * Returns foreign keys and entity references.
98 *
99 * @return array
100 * [CRM_Core_Reference_Interface]
101 */
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']);
110 }
111 return Civi::$statics[__CLASS__]['links'];
112 }
113 /**
114 * Returns all the column names of this table
115 *
116 * @return array
117 */
118 static function &fields() {
119 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
120 Civi::$statics[__CLASS__]['fields'] = array(
121 'id' => array(
122 'name' => 'id',
123 'type' => CRM_Utils_Type::T_INT,
124 'title' => ts('Group Contact ID') ,
125 'description' => 'primary key',
126 'required' => true,
127 'table_name' => 'civicrm_group_contact',
128 'entity' => 'GroupContact',
129 'bao' => 'CRM_Contact_BAO_GroupContact',
130 'localizable' => 0,
131 ) ,
132 'group_id' => array(
133 'name' => 'group_id',
134 'type' => CRM_Utils_Type::T_INT,
135 'title' => ts('Group ID') ,
136 'description' => 'FK to civicrm_group',
137 'required' => true,
138 'table_name' => 'civicrm_group_contact',
139 'entity' => 'GroupContact',
140 'bao' => 'CRM_Contact_BAO_GroupContact',
141 'localizable' => 0,
142 'FKClassName' => 'CRM_Contact_DAO_Group',
143 'html' => array(
144 'type' => 'Select',
145 ) ,
146 'pseudoconstant' => array(
147 'table' => 'civicrm_group',
148 'keyColumn' => 'id',
149 'labelColumn' => 'title',
150 )
151 ) ,
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',
157 'required' => true,
158 'table_name' => 'civicrm_group_contact',
159 'entity' => 'GroupContact',
160 'bao' => 'CRM_Contact_BAO_GroupContact',
161 'localizable' => 0,
162 'FKClassName' => 'CRM_Contact_DAO_Contact',
163 ) ,
164 'status' => array(
165 'name' => 'status',
166 'type' => CRM_Utils_Type::T_STRING,
167 'title' => ts('Group Contact Status') ,
168 'description' => 'status of contact relative to membership in group',
169 'maxlength' => 8,
170 'size' => CRM_Utils_Type::EIGHT,
171 'table_name' => 'civicrm_group_contact',
172 'entity' => 'GroupContact',
173 'bao' => 'CRM_Contact_BAO_GroupContact',
174 'localizable' => 0,
175 'html' => array(
176 'type' => 'Select',
177 ) ,
178 'pseudoconstant' => array(
179 'callback' => 'CRM_Core_SelectValues::groupContactStatus',
180 )
181 ) ,
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',
190 'localizable' => 0,
191 'FKClassName' => 'CRM_Core_DAO_LocBlock',
192 ) ,
193 'email_id' => array(
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',
201 'localizable' => 0,
202 'FKClassName' => 'CRM_Core_DAO_Email',
203 ) ,
204 );
205 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
206 }
207 return Civi::$statics[__CLASS__]['fields'];
208 }
209 /**
210 * Return a mapping from field-name to the corresponding key (as used in fields()).
211 *
212 * @return array
213 * Array(string $name => string $uniqueName).
214 */
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()));
218 }
219 return Civi::$statics[__CLASS__]['fieldKeys'];
220 }
221 /**
222 * Returns the names of this table
223 *
224 * @return string
225 */
226 static function getTableName() {
227 return self::$_tableName;
228 }
229 /**
230 * Returns if this table needs to be logged
231 *
232 * @return boolean
233 */
234 function getLog() {
235 return self::$_log;
236 }
237 /**
238 * Returns the list of fields that can be imported
239 *
240 * @param bool $prefix
241 *
242 * @return array
243 */
244 static function &import($prefix = false) {
245 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'group_contact', $prefix, array());
246 return $r;
247 }
248 /**
249 * Returns the list of fields that can be exported
250 *
251 * @param bool $prefix
252 *
253 * @return array
254 */
255 static function &export($prefix = false) {
256 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'group_contact', $prefix, array());
257 return $r;
258 }
259 }