5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/Domain.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:c5d80d8a9e689b48c5f6373b9229c442)
13 * Database access object for the Domain entity.
15 class CRM_Core_DAO_Domain
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_domain';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Name of Domain / Organization
46 * Description of Domain.
53 * Backend configuration.
57 public $config_backend;
60 * The civicrm version this instance is running
67 * FK to Contact ID. This is specifically not an FK to avoid circular constraints
74 * list of locales supported by the current db state (NULL for single-lang install)
81 * Locale specific string overrides
85 public $locale_custom_strings;
90 public function __construct() {
91 $this->__table
= 'civicrm_domain';
92 parent
::__construct();
96 * Returns foreign keys and entity references.
99 * [CRM_Core_Reference_Interface]
101 public static function getReferenceColumns() {
102 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
103 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
104 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
105 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
107 return Civi
::$statics[__CLASS__
]['links'];
111 * Returns all the column names of this table
115 public static function &fields() {
116 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
117 Civi
::$statics[__CLASS__
]['fields'] = [
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Domain ID'),
122 'description' => ts('Domain ID'),
124 'where' => 'civicrm_domain.id',
125 'table_name' => 'civicrm_domain',
126 'entity' => 'Domain',
127 'bao' => 'CRM_Core_BAO_Domain',
132 'type' => CRM_Utils_Type
::T_STRING
,
133 'title' => ts('Domain Name'),
134 'description' => ts('Name of Domain / Organization'),
136 'size' => CRM_Utils_Type
::BIG
,
137 'where' => 'civicrm_domain.name',
138 'table_name' => 'civicrm_domain',
139 'entity' => 'Domain',
140 'bao' => 'CRM_Core_BAO_Domain',
147 'name' => 'description',
148 'type' => CRM_Utils_Type
::T_STRING
,
149 'title' => ts('Domain Description'),
150 'description' => ts('Description of Domain.'),
152 'size' => CRM_Utils_Type
::HUGE
,
153 'where' => 'civicrm_domain.description',
154 'table_name' => 'civicrm_domain',
155 'entity' => 'Domain',
156 'bao' => 'CRM_Core_BAO_Domain',
162 'config_backend' => [
163 'name' => 'config_backend',
164 'type' => CRM_Utils_Type
::T_TEXT
,
165 'title' => ts('Domain Configuration'),
166 'description' => ts('Backend configuration.'),
167 'where' => 'civicrm_domain.config_backend',
168 'table_name' => 'civicrm_domain',
169 'entity' => 'Domain',
170 'bao' => 'CRM_Core_BAO_Domain',
172 'serialize' => self
::SERIALIZE_PHP
,
176 'type' => CRM_Utils_Type
::T_STRING
,
177 'title' => ts('CiviCRM Version'),
178 'description' => ts('The civicrm version this instance is running'),
180 'size' => CRM_Utils_Type
::MEDIUM
,
181 'where' => 'civicrm_domain.version',
182 'table_name' => 'civicrm_domain',
183 'entity' => 'Domain',
184 'bao' => 'CRM_Core_BAO_Domain',
188 'name' => 'contact_id',
189 'type' => CRM_Utils_Type
::T_INT
,
190 'title' => ts('Domain Contact'),
191 'description' => ts('FK to Contact ID. This is specifically not an FK to avoid circular constraints'),
192 'where' => 'civicrm_domain.contact_id',
193 'table_name' => 'civicrm_domain',
194 'entity' => 'Domain',
195 'bao' => 'CRM_Core_BAO_Domain',
197 'FKClassName' => 'CRM_Contact_DAO_Contact',
201 'type' => CRM_Utils_Type
::T_TEXT
,
202 'title' => ts('Supported Languages'),
203 'description' => ts('list of locales supported by the current db state (NULL for single-lang install)'),
204 'where' => 'civicrm_domain.locales',
205 'table_name' => 'civicrm_domain',
206 'entity' => 'Domain',
207 'bao' => 'CRM_Core_BAO_Domain',
210 'locale_custom_strings' => [
211 'name' => 'locale_custom_strings',
212 'type' => CRM_Utils_Type
::T_TEXT
,
213 'title' => ts('Language Customizations'),
214 'description' => ts('Locale specific string overrides'),
215 'where' => 'civicrm_domain.locale_custom_strings',
216 'table_name' => 'civicrm_domain',
217 'entity' => 'Domain',
218 'bao' => 'CRM_Core_BAO_Domain',
220 'serialize' => self
::SERIALIZE_PHP
,
223 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
225 return Civi
::$statics[__CLASS__
]['fields'];
229 * Return a mapping from field-name to the corresponding key (as used in fields()).
232 * Array(string $name => string $uniqueName).
234 public static function &fieldKeys() {
235 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
236 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
238 return Civi
::$statics[__CLASS__
]['fieldKeys'];
242 * Returns the names of this table
246 public static function getTableName() {
247 return self
::$_tableName;
251 * Returns if this table needs to be logged
255 public function getLog() {
260 * Returns the list of fields that can be imported
262 * @param bool $prefix
266 public static function &import($prefix = FALSE) {
267 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'domain', $prefix, []);
272 * Returns the list of fields that can be exported
274 * @param bool $prefix
278 public static function &export($prefix = FALSE) {
279 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'domain', $prefix, []);
284 * Returns the list of indices
286 * @param bool $localize
290 public static function indices($localize = TRUE) {
297 'localizable' => FALSE,
299 'sig' => 'civicrm_domain::1::name',
302 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;