Merge pull request #10040 from jaapjansma/CRM-20333
[civicrm-core.git] / CRM / Core / DAO / Domain.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/Core/Domain.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:aab20d05e6c3ebe8f6eb8a7de50190a0)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Core_DAO_Domain constructor.
39 */
40 class CRM_Core_DAO_Domain extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_domain';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 /**
102 * Class constructor.
103 */
104 function __construct() {
105 $this->__table = 'civicrm_domain';
106 parent::__construct();
107 }
108 /**
109 * Returns foreign keys and entity references.
110 *
111 * @return array
112 * [CRM_Core_Reference_Interface]
113 */
114 static function getReferenceColumns() {
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']);
119 }
120 return Civi::$statics[__CLASS__]['links'];
121 }
122 /**
123 * Returns all the column names of this table
124 *
125 * @return array
126 */
127 static function &fields() {
128 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
129 Civi::$statics[__CLASS__]['fields'] = array(
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,
136 'table_name' => 'civicrm_domain',
137 'entity' => 'Domain',
138 'bao' => 'CRM_Core_BAO_Domain',
139 ) ,
140 'name' => array(
141 'name' => 'name',
142 'type' => CRM_Utils_Type::T_STRING,
143 'title' => ts('Domain Name') ,
144 'description' => 'Name of Domain / Organization',
145 'maxlength' => 64,
146 'size' => CRM_Utils_Type::BIG,
147 'table_name' => 'civicrm_domain',
148 'entity' => 'Domain',
149 'bao' => 'CRM_Core_BAO_Domain',
150 'html' => array(
151 'type' => 'Text',
152 ) ,
153 ) ,
154 'description' => array(
155 'name' => 'description',
156 'type' => CRM_Utils_Type::T_STRING,
157 'title' => ts('Domain Description') ,
158 'description' => 'Description of Domain.',
159 'maxlength' => 255,
160 'size' => CRM_Utils_Type::HUGE,
161 'table_name' => 'civicrm_domain',
162 'entity' => 'Domain',
163 'bao' => 'CRM_Core_BAO_Domain',
164 'html' => array(
165 'type' => 'Text',
166 ) ,
167 ) ,
168 'config_backend' => array(
169 'name' => 'config_backend',
170 'type' => CRM_Utils_Type::T_TEXT,
171 'title' => ts('Domain Configuration') ,
172 'description' => 'Backend configuration.',
173 'rows' => 20,
174 'cols' => 80,
175 'table_name' => 'civicrm_domain',
176 'entity' => 'Domain',
177 'bao' => 'CRM_Core_BAO_Domain',
178 'html' => array(
179 'type' => 'TextArea',
180 ) ,
181 ) ,
182 'version' => array(
183 'name' => 'version',
184 'type' => CRM_Utils_Type::T_STRING,
185 'title' => ts('CiviCRM Version') ,
186 'description' => 'The civicrm version this instance is running',
187 'maxlength' => 32,
188 'size' => CRM_Utils_Type::MEDIUM,
189 'table_name' => 'civicrm_domain',
190 'entity' => 'Domain',
191 'bao' => 'CRM_Core_BAO_Domain',
192 ) ,
193 'contact_id' => array(
194 'name' => 'contact_id',
195 'type' => CRM_Utils_Type::T_INT,
196 'title' => ts('Domain Contact') ,
197 'description' => 'FK to Contact ID. This is specifically not an FK to avoid circular constraints',
198 'table_name' => 'civicrm_domain',
199 'entity' => 'Domain',
200 'bao' => 'CRM_Core_BAO_Domain',
201 'FKClassName' => 'CRM_Contact_DAO_Contact',
202 ) ,
203 'locales' => array(
204 'name' => 'locales',
205 'type' => CRM_Utils_Type::T_TEXT,
206 'title' => ts('Supported Languages') ,
207 'description' => 'list of locales supported by the current db state (NULL for single-lang install)',
208 'table_name' => 'civicrm_domain',
209 'entity' => 'Domain',
210 'bao' => 'CRM_Core_BAO_Domain',
211 ) ,
212 'locale_custom_strings' => array(
213 'name' => 'locale_custom_strings',
214 'type' => CRM_Utils_Type::T_TEXT,
215 'title' => ts('Language Customizations') ,
216 'description' => 'Locale specific string overrides',
217 'rows' => 20,
218 'cols' => 80,
219 'table_name' => 'civicrm_domain',
220 'entity' => 'Domain',
221 'bao' => 'CRM_Core_BAO_Domain',
222 'html' => array(
223 'type' => 'TextArea',
224 ) ,
225 ) ,
226 );
227 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
228 }
229 return Civi::$statics[__CLASS__]['fields'];
230 }
231 /**
232 * Return a mapping from field-name to the corresponding key (as used in fields()).
233 *
234 * @return array
235 * Array(string $name => string $uniqueName).
236 */
237 static function &fieldKeys() {
238 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
239 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
240 }
241 return Civi::$statics[__CLASS__]['fieldKeys'];
242 }
243 /**
244 * Returns the names of this table
245 *
246 * @return string
247 */
248 static function getTableName() {
249 return self::$_tableName;
250 }
251 /**
252 * Returns if this table needs to be logged
253 *
254 * @return boolean
255 */
256 function getLog() {
257 return self::$_log;
258 }
259 /**
260 * Returns the list of fields that can be imported
261 *
262 * @param bool $prefix
263 *
264 * @return array
265 */
266 static function &import($prefix = false) {
267 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'domain', $prefix, array());
268 return $r;
269 }
270 /**
271 * Returns the list of fields that can be exported
272 *
273 * @param bool $prefix
274 *
275 * @return array
276 */
277 static function &export($prefix = false) {
278 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'domain', $prefix, array());
279 return $r;
280 }
281 }