5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Domain.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:cdd41aa071b68a8a4be6b28f7ca3a0a3)
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 * The civicrm version this instance is running
60 * FK to Contact ID. This is specifically not an FK to avoid circular constraints
67 * list of locales supported by the current db state (NULL for single-lang install)
74 * Locale specific string overrides
78 public $locale_custom_strings;
83 public function __construct() {
84 $this->__table
= 'civicrm_domain';
85 parent
::__construct();
89 * Returns foreign keys and entity references.
92 * [CRM_Core_Reference_Interface]
94 public static function getReferenceColumns() {
95 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
96 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
97 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
98 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
100 return Civi
::$statics[__CLASS__
]['links'];
104 * Returns all the column names of this table
108 public static function &fields() {
109 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
110 Civi
::$statics[__CLASS__
]['fields'] = [
113 'type' => CRM_Utils_Type
::T_INT
,
114 'title' => ts('Domain ID'),
115 'description' => ts('Domain ID'),
117 'where' => 'civicrm_domain.id',
118 'table_name' => 'civicrm_domain',
119 'entity' => 'Domain',
120 'bao' => 'CRM_Core_BAO_Domain',
125 'type' => CRM_Utils_Type
::T_STRING
,
126 'title' => ts('Domain Name'),
127 'description' => ts('Name of Domain / Organization'),
129 'size' => CRM_Utils_Type
::BIG
,
130 'where' => 'civicrm_domain.name',
131 'table_name' => 'civicrm_domain',
132 'entity' => 'Domain',
133 'bao' => 'CRM_Core_BAO_Domain',
140 'name' => 'description',
141 'type' => CRM_Utils_Type
::T_STRING
,
142 'title' => ts('Domain Description'),
143 'description' => ts('Description of Domain.'),
145 'size' => CRM_Utils_Type
::HUGE
,
146 'where' => 'civicrm_domain.description',
147 'table_name' => 'civicrm_domain',
148 'entity' => 'Domain',
149 'bao' => 'CRM_Core_BAO_Domain',
157 'type' => CRM_Utils_Type
::T_STRING
,
158 'title' => ts('CiviCRM Version'),
159 'description' => ts('The civicrm version this instance is running'),
161 'size' => CRM_Utils_Type
::MEDIUM
,
162 'where' => 'civicrm_domain.version',
163 'table_name' => 'civicrm_domain',
164 'entity' => 'Domain',
165 'bao' => 'CRM_Core_BAO_Domain',
169 'name' => 'contact_id',
170 'type' => CRM_Utils_Type
::T_INT
,
171 'title' => ts('Domain Contact'),
172 'description' => ts('FK to Contact ID. This is specifically not an FK to avoid circular constraints'),
173 'where' => 'civicrm_domain.contact_id',
174 'table_name' => 'civicrm_domain',
175 'entity' => 'Domain',
176 'bao' => 'CRM_Core_BAO_Domain',
178 'FKClassName' => 'CRM_Contact_DAO_Contact',
182 'type' => CRM_Utils_Type
::T_TEXT
,
183 'title' => ts('Supported Languages'),
184 'description' => ts('list of locales supported by the current db state (NULL for single-lang install)'),
185 'where' => 'civicrm_domain.locales',
186 'table_name' => 'civicrm_domain',
187 'entity' => 'Domain',
188 'bao' => 'CRM_Core_BAO_Domain',
191 'locale_custom_strings' => [
192 'name' => 'locale_custom_strings',
193 'type' => CRM_Utils_Type
::T_TEXT
,
194 'title' => ts('Language Customizations'),
195 'description' => ts('Locale specific string overrides'),
196 'where' => 'civicrm_domain.locale_custom_strings',
197 'table_name' => 'civicrm_domain',
198 'entity' => 'Domain',
199 'bao' => 'CRM_Core_BAO_Domain',
201 'serialize' => self
::SERIALIZE_PHP
,
204 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
206 return Civi
::$statics[__CLASS__
]['fields'];
210 * Return a mapping from field-name to the corresponding key (as used in fields()).
213 * Array(string $name => string $uniqueName).
215 public static function &fieldKeys() {
216 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
217 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
219 return Civi
::$statics[__CLASS__
]['fieldKeys'];
223 * Returns the names of this table
227 public static function getTableName() {
228 return self
::$_tableName;
232 * Returns if this table needs to be logged
236 public function getLog() {
241 * Returns the list of fields that can be imported
243 * @param bool $prefix
247 public static function &import($prefix = FALSE) {
248 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'domain', $prefix, []);
253 * Returns the list of fields that can be exported
255 * @param bool $prefix
259 public static function &export($prefix = FALSE) {
260 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'domain', $prefix, []);
265 * Returns the list of indices
267 * @param bool $localize
271 public static function indices($localize = TRUE) {
278 'localizable' => FALSE,
280 'sig' => 'civicrm_domain::1::name',
283 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;