CRM-19130 - Regen DAOs with updated fields() and links()
[civicrm-core.git] / CRM / Core / DAO / Domain.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/Domain.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:a403ee4e3ef5f8398d0103c8a5ba1645)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_Domain extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_domain';
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = false;
51 /**
52 * Domain ID
53 *
54 * @var int unsigned
55 */
56 public $id;
57 /**
58 * Name of Domain / Organization
59 *
60 * @var string
61 */
62 public $name;
63 /**
64 * Description of Domain.
65 *
66 * @var string
67 */
68 public $description;
69 /**
70 * Backend configuration.
71 *
72 * @var text
73 */
74 public $config_backend;
75 /**
76 * The civicrm version this instance is running
77 *
78 * @var string
79 */
80 public $version;
81 /**
82 * FK to Contact ID. This is specifically not an FK to avoid circular constraints
83 *
84 * @var int unsigned
85 */
86 public $contact_id;
87 /**
88 * list of locales supported by the current db state (NULL for single-lang install)
89 *
90 * @var text
91 */
92 public $locales;
93 /**
94 * Locale specific string overrides
95 *
96 * @var text
97 */
98 public $locale_custom_strings;
99 /**
100 * class constructor
101 *
102 * @return civicrm_domain
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 ) ,
137 'name' => array(
138 'name' => 'name',
139 'type' => CRM_Utils_Type::T_STRING,
140 'title' => ts('Domain Name') ,
141 'description' => 'Name of Domain / Organization',
142 'maxlength' => 64,
143 'size' => CRM_Utils_Type::BIG,
144 'html' => array(
145 'type' => 'Text',
146 ) ,
147 ) ,
148 'description' => array(
149 'name' => 'description',
150 'type' => CRM_Utils_Type::T_STRING,
151 'title' => ts('Domain Description') ,
152 'description' => 'Description of Domain.',
153 'maxlength' => 255,
154 'size' => CRM_Utils_Type::HUGE,
155 'html' => array(
156 'type' => 'Text',
157 ) ,
158 ) ,
159 'config_backend' => array(
160 'name' => 'config_backend',
161 'type' => CRM_Utils_Type::T_TEXT,
162 'title' => ts('Domain Configuration') ,
163 'description' => 'Backend configuration.',
164 'rows' => 20,
165 'cols' => 80,
166 'html' => array(
167 'type' => 'TextArea',
168 ) ,
169 ) ,
170 'version' => array(
171 'name' => 'version',
172 'type' => CRM_Utils_Type::T_STRING,
173 'title' => ts('CiviCRM Version') ,
174 'description' => 'The civicrm version this instance is running',
175 'maxlength' => 32,
176 'size' => CRM_Utils_Type::MEDIUM,
177 ) ,
178 'contact_id' => array(
179 'name' => 'contact_id',
180 'type' => CRM_Utils_Type::T_INT,
181 'title' => ts('Domain Contact') ,
182 'description' => 'FK to Contact ID. This is specifically not an FK to avoid circular constraints',
183 'FKClassName' => 'CRM_Contact_DAO_Contact',
184 ) ,
185 'locales' => array(
186 'name' => 'locales',
187 'type' => CRM_Utils_Type::T_TEXT,
188 'title' => ts('Supported Languages') ,
189 'description' => 'list of locales supported by the current db state (NULL for single-lang install)',
190 ) ,
191 'locale_custom_strings' => array(
192 'name' => 'locale_custom_strings',
193 'type' => CRM_Utils_Type::T_TEXT,
194 'title' => ts('Language Customizations') ,
195 'description' => 'Locale specific string overrides',
196 'rows' => 20,
197 'cols' => 80,
198 'html' => array(
199 'type' => 'TextArea',
200 ) ,
201 ) ,
202 );
203 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
204 }
205 return Civi::$statics[__CLASS__]['fields'];
206 }
207 /**
208 * Return a mapping from field-name to the corresponding key (as used in fields()).
209 *
210 * @return array
211 * Array(string $name => string $uniqueName).
212 */
213 static function &fieldKeys() {
214 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
215 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
216 }
217 return Civi::$statics[__CLASS__]['fieldKeys'];
218 }
219 /**
220 * Returns the names of this table
221 *
222 * @return string
223 */
224 static function getTableName() {
225 return self::$_tableName;
226 }
227 /**
228 * Returns if this table needs to be logged
229 *
230 * @return boolean
231 */
232 function getLog() {
233 return self::$_log;
234 }
235 /**
236 * Returns the list of fields that can be imported
237 *
238 * @param bool $prefix
239 *
240 * @return array
241 */
242 static function &import($prefix = false) {
243 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'domain', $prefix, array());
244 return $r;
245 }
246 /**
247 * Returns the list of fields that can be exported
248 *
249 * @param bool $prefix
250 *
251 * @return array
252 */
253 static function &export($prefix = false) {
254 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'domain', $prefix, array());
255 return $r;
256 }
257 }