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