5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/Domain.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:7bc078fa4adebf142c73c95fab321f25)
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 static $_tableName = 'civicrm_domain';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'Domain ID',
124 'table_name' => 'civicrm_domain',
125 'entity' => 'Domain',
126 'bao' => 'CRM_Core_BAO_Domain',
131 'type' => CRM_Utils_Type
::T_STRING
,
132 'title' => ts('Domain Name'),
133 'description' => 'Name of Domain / Organization',
135 'size' => CRM_Utils_Type
::BIG
,
136 'table_name' => 'civicrm_domain',
137 'entity' => 'Domain',
138 'bao' => 'CRM_Core_BAO_Domain',
145 'name' => 'description',
146 'type' => CRM_Utils_Type
::T_STRING
,
147 'title' => ts('Domain Description'),
148 'description' => 'Description of Domain.',
150 'size' => CRM_Utils_Type
::HUGE
,
151 'table_name' => 'civicrm_domain',
152 'entity' => 'Domain',
153 'bao' => 'CRM_Core_BAO_Domain',
159 'config_backend' => [
160 'name' => 'config_backend',
161 'type' => CRM_Utils_Type
::T_TEXT
,
162 'title' => ts('Domain Configuration'),
163 'description' => 'Backend configuration.',
164 'table_name' => 'civicrm_domain',
165 'entity' => 'Domain',
166 'bao' => 'CRM_Core_BAO_Domain',
168 'serialize' => self
::SERIALIZE_PHP
,
172 'type' => CRM_Utils_Type
::T_STRING
,
173 'title' => ts('CiviCRM Version'),
174 'description' => 'The civicrm version this instance is running',
176 'size' => CRM_Utils_Type
::MEDIUM
,
177 'table_name' => 'civicrm_domain',
178 'entity' => 'Domain',
179 'bao' => 'CRM_Core_BAO_Domain',
183 'name' => 'contact_id',
184 'type' => CRM_Utils_Type
::T_INT
,
185 'title' => ts('Domain Contact'),
186 'description' => 'FK to Contact ID. This is specifically not an FK to avoid circular constraints',
187 'table_name' => 'civicrm_domain',
188 'entity' => 'Domain',
189 'bao' => 'CRM_Core_BAO_Domain',
191 'FKClassName' => 'CRM_Contact_DAO_Contact',
195 'type' => CRM_Utils_Type
::T_TEXT
,
196 'title' => ts('Supported Languages'),
197 'description' => 'list of locales supported by the current db state (NULL for single-lang install)',
198 'table_name' => 'civicrm_domain',
199 'entity' => 'Domain',
200 'bao' => 'CRM_Core_BAO_Domain',
203 'locale_custom_strings' => [
204 'name' => 'locale_custom_strings',
205 'type' => CRM_Utils_Type
::T_TEXT
,
206 'title' => ts('Language Customizations'),
207 'description' => 'Locale specific string overrides',
208 'table_name' => 'civicrm_domain',
209 'entity' => 'Domain',
210 'bao' => 'CRM_Core_BAO_Domain',
212 'serialize' => self
::SERIALIZE_PHP
,
215 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
217 return Civi
::$statics[__CLASS__
]['fields'];
221 * Return a mapping from field-name to the corresponding key (as used in fields()).
224 * Array(string $name => string $uniqueName).
226 public static function &fieldKeys() {
227 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
228 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
230 return Civi
::$statics[__CLASS__
]['fieldKeys'];
234 * Returns the names of this table
238 public static function getTableName() {
239 return self
::$_tableName;
243 * Returns if this table needs to be logged
247 public function getLog() {
252 * Returns the list of fields that can be imported
254 * @param bool $prefix
258 public static function &import($prefix = FALSE) {
259 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'domain', $prefix, []);
264 * Returns the list of fields that can be exported
266 * @param bool $prefix
270 public static function &export($prefix = FALSE) {
271 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'domain', $prefix, []);
276 * Returns the list of indices
278 * @param bool $localize
282 public static function indices($localize = TRUE) {
289 'localizable' => FALSE,
291 'sig' => 'civicrm_domain::1::name',
294 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;