Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
0f03f337 | 6 | | Copyright CiviCRM LLC (c) 2004-2017 | |
e501603b TO |
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 | |
0f03f337 | 29 | * @copyright CiviCRM LLC (c) 2004-2017 |
e501603b TO |
30 | * |
31 | * Generated from xml/schema/CRM/Core/Domain.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
e7a6b91a | 33 | * (GenCodeChecksum:50edefeb24aa64d2125df018985cd701) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
f41f0342 | 37 | /** |
38 | * CRM_Core_DAO_Domain constructor. | |
39 | */ | |
e501603b TO |
40 | class CRM_Core_DAO_Domain extends CRM_Core_DAO { |
41 | /** | |
f41f0342 | 42 | * Static instance to hold the table name. |
e501603b TO |
43 | * |
44 | * @var string | |
45 | */ | |
46 | static $_tableName = 'civicrm_domain'; | |
e501603b | 47 | /** |
f41f0342 | 48 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b TO |
49 | * |
50 | * @var boolean | |
51 | */ | |
52 | static $_log = false; | |
53 | /** | |
54 | * Domain ID | |
55 | * | |
56 | * @var int unsigned | |
57 | */ | |
58 | public $id; | |
59 | /** | |
60 | * Name of Domain / Organization | |
61 | * | |
62 | * @var string | |
63 | */ | |
64 | public $name; | |
65 | /** | |
66 | * Description of Domain. | |
67 | * | |
68 | * @var string | |
69 | */ | |
70 | public $description; | |
71 | /** | |
72 | * Backend configuration. | |
73 | * | |
74 | * @var text | |
75 | */ | |
76 | public $config_backend; | |
77 | /** | |
78 | * The civicrm version this instance is running | |
79 | * | |
80 | * @var string | |
81 | */ | |
82 | public $version; | |
83 | /** | |
84 | * FK to Contact ID. This is specifically not an FK to avoid circular constraints | |
85 | * | |
86 | * @var int unsigned | |
87 | */ | |
88 | public $contact_id; | |
89 | /** | |
90 | * list of locales supported by the current db state (NULL for single-lang install) | |
91 | * | |
92 | * @var text | |
93 | */ | |
94 | public $locales; | |
95 | /** | |
96 | * Locale specific string overrides | |
97 | * | |
98 | * @var text | |
99 | */ | |
100 | public $locale_custom_strings; | |
101 | /** | |
f41f0342 | 102 | * Class constructor. |
e501603b TO |
103 | */ |
104 | function __construct() { | |
105 | $this->__table = 'civicrm_domain'; | |
106 | parent::__construct(); | |
107 | } | |
108 | /** | |
f41f0342 | 109 | * Returns foreign keys and entity references. |
e501603b TO |
110 | * |
111 | * @return array | |
112 | * [CRM_Core_Reference_Interface] | |
113 | */ | |
114 | static function getReferenceColumns() { | |
346aaaba TO |
115 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
116 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); | |
117 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); | |
118 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); | |
e501603b | 119 | } |
346aaaba | 120 | return Civi::$statics[__CLASS__]['links']; |
e501603b TO |
121 | } |
122 | /** | |
123 | * Returns all the column names of this table | |
124 | * | |
125 | * @return array | |
126 | */ | |
127 | static function &fields() { | |
346aaaba TO |
128 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
129 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
130 | 'id' => array( |
131 | 'name' => 'id', | |
132 | 'type' => CRM_Utils_Type::T_INT, | |
133 | 'title' => ts('Domain ID') , | |
134 | 'description' => 'Domain ID', | |
135 | 'required' => true, | |
522a26c9 | 136 | 'table_name' => 'civicrm_domain', |
137 | 'entity' => 'Domain', | |
138 | 'bao' => 'CRM_Core_BAO_Domain', | |
6a7e5e5d | 139 | 'localizable' => 0, |
e501603b TO |
140 | ) , |
141 | 'name' => array( | |
142 | 'name' => 'name', | |
143 | 'type' => CRM_Utils_Type::T_STRING, | |
144 | 'title' => ts('Domain Name') , | |
145 | 'description' => 'Name of Domain / Organization', | |
146 | 'maxlength' => 64, | |
147 | 'size' => CRM_Utils_Type::BIG, | |
522a26c9 | 148 | 'table_name' => 'civicrm_domain', |
149 | 'entity' => 'Domain', | |
150 | 'bao' => 'CRM_Core_BAO_Domain', | |
6a7e5e5d | 151 | 'localizable' => 0, |
e501603b TO |
152 | 'html' => array( |
153 | 'type' => 'Text', | |
154 | ) , | |
155 | ) , | |
156 | 'description' => array( | |
157 | 'name' => 'description', | |
158 | 'type' => CRM_Utils_Type::T_STRING, | |
159 | 'title' => ts('Domain Description') , | |
160 | 'description' => 'Description of Domain.', | |
161 | 'maxlength' => 255, | |
162 | 'size' => CRM_Utils_Type::HUGE, | |
522a26c9 | 163 | 'table_name' => 'civicrm_domain', |
164 | 'entity' => 'Domain', | |
165 | 'bao' => 'CRM_Core_BAO_Domain', | |
6a7e5e5d | 166 | 'localizable' => 0, |
e501603b TO |
167 | 'html' => array( |
168 | 'type' => 'Text', | |
169 | ) , | |
170 | ) , | |
171 | 'config_backend' => array( | |
172 | 'name' => 'config_backend', | |
173 | 'type' => CRM_Utils_Type::T_TEXT, | |
174 | 'title' => ts('Domain Configuration') , | |
175 | 'description' => 'Backend configuration.', | |
176 | 'rows' => 20, | |
177 | 'cols' => 80, | |
522a26c9 | 178 | 'table_name' => 'civicrm_domain', |
179 | 'entity' => 'Domain', | |
180 | 'bao' => 'CRM_Core_BAO_Domain', | |
6a7e5e5d | 181 | 'localizable' => 0, |
e501603b TO |
182 | 'html' => array( |
183 | 'type' => 'TextArea', | |
184 | ) , | |
185 | ) , | |
186 | 'version' => array( | |
187 | 'name' => 'version', | |
188 | 'type' => CRM_Utils_Type::T_STRING, | |
189 | 'title' => ts('CiviCRM Version') , | |
190 | 'description' => 'The civicrm version this instance is running', | |
191 | 'maxlength' => 32, | |
192 | 'size' => CRM_Utils_Type::MEDIUM, | |
522a26c9 | 193 | 'table_name' => 'civicrm_domain', |
194 | 'entity' => 'Domain', | |
195 | 'bao' => 'CRM_Core_BAO_Domain', | |
6a7e5e5d | 196 | 'localizable' => 0, |
e501603b TO |
197 | ) , |
198 | 'contact_id' => array( | |
199 | 'name' => 'contact_id', | |
200 | 'type' => CRM_Utils_Type::T_INT, | |
201 | 'title' => ts('Domain Contact') , | |
202 | 'description' => 'FK to Contact ID. This is specifically not an FK to avoid circular constraints', | |
522a26c9 | 203 | 'table_name' => 'civicrm_domain', |
204 | 'entity' => 'Domain', | |
205 | 'bao' => 'CRM_Core_BAO_Domain', | |
6a7e5e5d | 206 | 'localizable' => 0, |
e501603b TO |
207 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
208 | ) , | |
209 | 'locales' => array( | |
210 | 'name' => 'locales', | |
211 | 'type' => CRM_Utils_Type::T_TEXT, | |
212 | 'title' => ts('Supported Languages') , | |
213 | 'description' => 'list of locales supported by the current db state (NULL for single-lang install)', | |
522a26c9 | 214 | 'table_name' => 'civicrm_domain', |
215 | 'entity' => 'Domain', | |
216 | 'bao' => 'CRM_Core_BAO_Domain', | |
6a7e5e5d | 217 | 'localizable' => 0, |
e501603b TO |
218 | ) , |
219 | 'locale_custom_strings' => array( | |
220 | 'name' => 'locale_custom_strings', | |
221 | 'type' => CRM_Utils_Type::T_TEXT, | |
222 | 'title' => ts('Language Customizations') , | |
223 | 'description' => 'Locale specific string overrides', | |
224 | 'rows' => 20, | |
225 | 'cols' => 80, | |
522a26c9 | 226 | 'table_name' => 'civicrm_domain', |
227 | 'entity' => 'Domain', | |
228 | 'bao' => 'CRM_Core_BAO_Domain', | |
6a7e5e5d | 229 | 'localizable' => 0, |
e501603b TO |
230 | 'html' => array( |
231 | 'type' => 'TextArea', | |
232 | ) , | |
233 | ) , | |
234 | ); | |
346aaaba | 235 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 236 | } |
346aaaba | 237 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
238 | } |
239 | /** | |
bd8e0b14 | 240 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
241 | * |
242 | * @return array | |
bd8e0b14 | 243 | * Array(string $name => string $uniqueName). |
e501603b TO |
244 | */ |
245 | static function &fieldKeys() { | |
bd8e0b14 TO |
246 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
247 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 248 | } |
bd8e0b14 | 249 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
250 | } |
251 | /** | |
252 | * Returns the names of this table | |
253 | * | |
254 | * @return string | |
255 | */ | |
256 | static function getTableName() { | |
257 | return self::$_tableName; | |
258 | } | |
259 | /** | |
260 | * Returns if this table needs to be logged | |
261 | * | |
262 | * @return boolean | |
263 | */ | |
264 | function getLog() { | |
265 | return self::$_log; | |
266 | } | |
267 | /** | |
268 | * Returns the list of fields that can be imported | |
269 | * | |
270 | * @param bool $prefix | |
271 | * | |
272 | * @return array | |
273 | */ | |
274 | static function &import($prefix = false) { | |
60808919 TO |
275 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'domain', $prefix, array()); |
276 | return $r; | |
e501603b TO |
277 | } |
278 | /** | |
279 | * Returns the list of fields that can be exported | |
280 | * | |
281 | * @param bool $prefix | |
282 | * | |
283 | * @return array | |
284 | */ | |
285 | static function &export($prefix = false) { | |
60808919 TO |
286 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'domain', $prefix, array()); |
287 | return $r; | |
e501603b | 288 | } |
e7a6b91a AS |
289 | /** |
290 | * Returns the list of indices | |
291 | */ | |
292 | public static function indices($localize = TRUE) { | |
293 | $indices = array( | |
294 | 'UI_name' => array( | |
295 | 'name' => 'UI_name', | |
296 | 'field' => array( | |
297 | 0 => 'name', | |
298 | ) , | |
299 | 'localizable' => false, | |
300 | 'unique' => true, | |
301 | 'sig' => 'civicrm_domain::1::name', | |
302 | ) , | |
303 | ); | |
304 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; | |
305 | } | |
e501603b | 306 | } |