fixup CRM-14885 - Import DAOs
[civicrm-core.git] / CRM / Contact / DAO / GroupOrganization.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
6| Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
30 *
31 * Generated from xml/schema/CRM/Contact/GroupOrganization.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:df04af8d9ec7a806781ad82b08145a47)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Contact_DAO_GroupOrganization extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_group_organization';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static instance to hold the values that can
64 * be imported
65 *
66 * @var array
67 */
68 static $_import = null;
69 /**
70 * static instance to hold the values that can
71 * be exported
72 *
73 * @var array
74 */
75 static $_export = null;
76 /**
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
79 *
80 * @var boolean
81 */
82 static $_log = true;
83 /**
84 * Relationship ID
85 *
86 * @var int unsigned
87 */
88 public $id;
89 /**
90 * ID of the group
91 *
92 * @var int unsigned
93 */
94 public $group_id;
95 /**
96 * ID of the Organization Contact
97 *
98 * @var int unsigned
99 */
100 public $organization_id;
101 /**
102 * class constructor
103 *
104 * @return civicrm_group_organization
105 */
106 function __construct() {
107 $this->__table = 'civicrm_group_organization';
108 parent::__construct();
109 }
110 /**
111 * Returns foreign keys and entity references
112 *
113 * @return array
114 * [CRM_Core_Reference_Interface]
115 */
116 static function getReferenceColumns() {
117 if (!self::$_links) {
118 self::$_links = static ::createReferenceColumns(__CLASS__);
119 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id');
120 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'organization_id', 'civicrm_contact', 'id');
121 }
122 return self::$_links;
123 }
124 /**
125 * Returns all the column names of this table
126 *
127 * @return array
128 */
129 static function &fields() {
130 if (!(self::$_fields)) {
131 self::$_fields = array(
132 'id' => array(
133 'name' => 'id',
134 'type' => CRM_Utils_Type::T_INT,
135 'title' => ts('Group Organization ID') ,
136 'description' => 'Relationship ID',
137 'required' => true,
138 ) ,
139 'group_id' => array(
140 'name' => 'group_id',
141 'type' => CRM_Utils_Type::T_INT,
142 'title' => ts('Group') ,
143 'description' => 'ID of the group',
144 'required' => true,
145 'FKClassName' => 'CRM_Contact_DAO_Group',
146 'html' => array(
147 'type' => 'Select',
148 ) ,
149 'pseudoconstant' => array(
150 'table' => 'civicrm_group',
151 'keyColumn' => 'id',
152 'labelColumn' => 'title',
153 )
154 ) ,
155 'organization_id' => array(
156 'name' => 'organization_id',
157 'type' => CRM_Utils_Type::T_INT,
158 'title' => ts('Organization') ,
159 'description' => 'ID of the Organization Contact',
160 'required' => true,
161 'FKClassName' => 'CRM_Contact_DAO_Contact',
162 ) ,
163 );
164 }
165 return self::$_fields;
166 }
167 /**
168 * Returns an array containing, for each field, the arary key used for that
169 * field in self::$_fields.
170 *
171 * @return array
172 */
173 static function &fieldKeys() {
174 if (!(self::$_fieldKeys)) {
175 self::$_fieldKeys = array(
176 'id' => 'id',
177 'group_id' => 'group_id',
178 'organization_id' => 'organization_id',
179 );
180 }
181 return self::$_fieldKeys;
182 }
183 /**
184 * Returns the names of this table
185 *
186 * @return string
187 */
188 static function getTableName() {
189 return self::$_tableName;
190 }
191 /**
192 * Returns if this table needs to be logged
193 *
194 * @return boolean
195 */
196 function getLog() {
197 return self::$_log;
198 }
199 /**
200 * Returns the list of fields that can be imported
201 *
202 * @param bool $prefix
203 *
204 * @return array
205 */
206 static function &import($prefix = false) {
207 if (!(self::$_import)) {
208 self::$_import = array();
209 $fields = self::fields();
210 foreach($fields as $name => $field) {
211 if (CRM_Utils_Array::value('import', $field)) {
212 if ($prefix) {
213 self::$_import['group_organization'] = & $fields[$name];
214 } else {
215 self::$_import[$name] = & $fields[$name];
216 }
217 }
218 }
219 }
220 return self::$_import;
221 }
222 /**
223 * Returns the list of fields that can be exported
224 *
225 * @param bool $prefix
226 *
227 * @return array
228 */
229 static function &export($prefix = false) {
230 if (!(self::$_export)) {
231 self::$_export = array();
232 $fields = self::fields();
233 foreach($fields as $name => $field) {
234 if (CRM_Utils_Array::value('export', $field)) {
235 if ($prefix) {
236 self::$_export['group_organization'] = & $fields[$name];
237 } else {
238 self::$_export[$name] = & $fields[$name];
239 }
240 }
241 }
242 }
243 return self::$_export;
244 }
245}