CRM-14885 - Import DAO's
[civicrm-core.git] / CRM / Core / DAO / UFMatch.php
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/Core/UFMatch.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:3918388730a704a411f3b1daf2cdfded)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_UFMatch extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_uf_match';
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 * System generated ID.
85 *
86 * @var int unsigned
87 */
88 public $id;
89 /**
90 * Which Domain is this match entry for
91 *
92 * @var int unsigned
93 */
94 public $domain_id;
95 /**
96 * UF ID
97 *
98 * @var int unsigned
99 */
100 public $uf_id;
101 /**
102 * UF Name
103 *
104 * @var string
105 */
106 public $uf_name;
107 /**
108 * FK to Contact ID
109 *
110 * @var int unsigned
111 */
112 public $contact_id;
113 /**
114 * UI language preferred by the given user/contact
115 *
116 * @var string
117 */
118 public $language;
119 /**
120 * class constructor
121 *
122 * @return civicrm_uf_match
123 */
124 function __construct() {
125 $this->__table = 'civicrm_uf_match';
126 parent::__construct();
127 }
128 /**
129 * Returns foreign keys and entity references
130 *
131 * @return array
132 * [CRM_Core_Reference_Interface]
133 */
134 static function getReferenceColumns() {
135 if (!self::$_links) {
136 self::$_links = static ::createReferenceColumns(__CLASS__);
137 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
138 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
139 }
140 return self::$_links;
141 }
142 /**
143 * Returns all the column names of this table
144 *
145 * @return array
146 */
147 static function &fields() {
148 if (!(self::$_fields)) {
149 self::$_fields = array(
150 'id' => array(
151 'name' => 'id',
152 'type' => CRM_Utils_Type::T_INT,
153 'title' => ts('UF Match ID') ,
154 'description' => 'System generated ID.',
155 'required' => true,
156 ) ,
157 'domain_id' => array(
158 'name' => 'domain_id',
159 'type' => CRM_Utils_Type::T_INT,
160 'title' => ts('UF Match Domain ID') ,
161 'description' => 'Which Domain is this match entry for',
162 'required' => true,
163 'FKClassName' => 'CRM_Core_DAO_Domain',
164 'pseudoconstant' => array(
165 'table' => 'civicrm_domain',
166 'keyColumn' => 'id',
167 'labelColumn' => 'name',
168 )
169 ) ,
170 'uf_id' => array(
171 'name' => 'uf_id',
172 'type' => CRM_Utils_Type::T_INT,
173 'title' => ts('CMS ID') ,
174 'description' => 'UF ID',
175 'required' => true,
176 ) ,
177 'uf_name' => array(
178 'name' => 'uf_name',
179 'type' => CRM_Utils_Type::T_STRING,
180 'title' => ts('CMS Unique Identifier') ,
181 'description' => 'UF Name',
182 'maxlength' => 128,
183 'size' => CRM_Utils_Type::HUGE,
184 ) ,
185 'contact_id' => array(
186 'name' => 'contact_id',
187 'type' => CRM_Utils_Type::T_INT,
188 'title' => ts('CiviCRM Contact ID') ,
189 'description' => 'FK to Contact ID',
190 'FKClassName' => 'CRM_Contact_DAO_Contact',
191 ) ,
192 'language' => array(
193 'name' => 'language',
194 'type' => CRM_Utils_Type::T_STRING,
195 'title' => ts('Preferred Language') ,
196 'description' => 'UI language preferred by the given user/contact',
197 'maxlength' => 5,
198 'size' => CRM_Utils_Type::SIX,
199 ) ,
200 );
201 }
202 return self::$_fields;
203 }
204 /**
205 * Returns an array containing, for each field, the arary key used for that
206 * field in self::$_fields.
207 *
208 * @return array
209 */
210 static function &fieldKeys() {
211 if (!(self::$_fieldKeys)) {
212 self::$_fieldKeys = array(
213 'id' => 'id',
214 'domain_id' => 'domain_id',
215 'uf_id' => 'uf_id',
216 'uf_name' => 'uf_name',
217 'contact_id' => 'contact_id',
218 'language' => 'language',
219 );
220 }
221 return self::$_fieldKeys;
222 }
223 /**
224 * Returns the names of this table
225 *
226 * @return string
227 */
228 static function getTableName() {
229 return self::$_tableName;
230 }
231 /**
232 * Returns if this table needs to be logged
233 *
234 * @return boolean
235 */
236 function getLog() {
237 return self::$_log;
238 }
239 /**
240 * Returns the list of fields that can be imported
241 *
242 * @param bool $prefix
243 *
244 * @return array
245 */
246 static function &import($prefix = false) {
247 if (!(self::$_import)) {
248 self::$_import = array();
249 $fields = self::fields();
250 foreach($fields as $name => $field) {
251 if (CRM_Utils_Array::value('import', $field)) {
252 if ($prefix) {
253 self::$_import['uf_match'] = & $fields[$name];
254 } else {
255 self::$_import[$name] = & $fields[$name];
256 }
257 }
258 }
259 }
260 return self::$_import;
261 }
262 /**
263 * Returns the list of fields that can be exported
264 *
265 * @param bool $prefix
266 *
267 * @return array
268 */
269 static function &export($prefix = false) {
270 if (!(self::$_export)) {
271 self::$_export = array();
272 $fields = self::fields();
273 foreach($fields as $name => $field) {
274 if (CRM_Utils_Array::value('export', $field)) {
275 if ($prefix) {
276 self::$_export['uf_match'] = & $fields[$name];
277 } else {
278 self::$_export[$name] = & $fields[$name];
279 }
280 }
281 }
282 }
283 return self::$_export;
284 }
285 }