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:99a50c29878792b8864e20d184ce9bbb)
13 * Database access object for the Domain entity.
15 class CRM_Core_DAO_Domain
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_domain';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * Name of Domain / Organization
48 * Description of Domain.
55 * The civicrm version this instance is running
62 * FK to Contact ID. This is specifically not an FK to avoid circular constraints
69 * list of locales supported by the current db state (NULL for single-lang install)
76 * Locale specific string overrides
80 public $locale_custom_strings;
85 public function __construct() {
86 $this->__table
= 'civicrm_domain';
87 parent
::__construct();
91 * Returns localized title of this entity.
94 * Whether to return the plural version of the title.
96 public static function getEntityTitle($plural = FALSE) {
97 return $plural ?
ts('Domains') : ts('Domain');
101 * Returns foreign keys and entity references.
104 * [CRM_Core_Reference_Interface]
106 public static function getReferenceColumns() {
107 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
108 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
109 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
110 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
112 return Civi
::$statics[__CLASS__
]['links'];
116 * Returns all the column names of this table
120 public static function &fields() {
121 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
122 Civi
::$statics[__CLASS__
]['fields'] = [
125 'type' => CRM_Utils_Type
::T_INT
,
126 'title' => ts('Domain ID'),
127 'description' => ts('Domain ID'),
129 'where' => 'civicrm_domain.id',
130 'table_name' => 'civicrm_domain',
131 'entity' => 'Domain',
132 'bao' => 'CRM_Core_BAO_Domain',
138 'type' => CRM_Utils_Type
::T_STRING
,
139 'title' => ts('Domain Name'),
140 'description' => ts('Name of Domain / Organization'),
142 'size' => CRM_Utils_Type
::BIG
,
143 'where' => 'civicrm_domain.name',
144 'table_name' => 'civicrm_domain',
145 'entity' => 'Domain',
146 'bao' => 'CRM_Core_BAO_Domain',
154 'name' => 'description',
155 'type' => CRM_Utils_Type
::T_STRING
,
156 'title' => ts('Domain Description'),
157 'description' => ts('Description of Domain.'),
159 'size' => CRM_Utils_Type
::HUGE
,
160 'where' => 'civicrm_domain.description',
161 'table_name' => 'civicrm_domain',
162 'entity' => 'Domain',
163 'bao' => 'CRM_Core_BAO_Domain',
172 'type' => CRM_Utils_Type
::T_STRING
,
173 'title' => ts('CiviCRM Version'),
174 'description' => ts('The civicrm version this instance is running'),
176 'size' => CRM_Utils_Type
::MEDIUM
,
177 'where' => 'civicrm_domain.version',
178 'table_name' => 'civicrm_domain',
179 'entity' => 'Domain',
180 'bao' => 'CRM_Core_BAO_Domain',
185 'name' => 'contact_id',
186 'type' => CRM_Utils_Type
::T_INT
,
187 'title' => ts('Domain Contact'),
188 'description' => ts('FK to Contact ID. This is specifically not an FK to avoid circular constraints'),
189 'where' => 'civicrm_domain.contact_id',
190 'table_name' => 'civicrm_domain',
191 'entity' => 'Domain',
192 'bao' => 'CRM_Core_BAO_Domain',
194 'FKClassName' => 'CRM_Contact_DAO_Contact',
199 'type' => CRM_Utils_Type
::T_TEXT
,
200 'title' => ts('Supported Languages'),
201 'description' => ts('list of locales supported by the current db state (NULL for single-lang install)'),
202 'where' => 'civicrm_domain.locales',
203 'table_name' => 'civicrm_domain',
204 'entity' => 'Domain',
205 'bao' => 'CRM_Core_BAO_Domain',
207 'serialize' => self
::SERIALIZE_SEPARATOR_TRIMMED
,
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
,
224 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
226 return Civi
::$statics[__CLASS__
]['fields'];
230 * Return a mapping from field-name to the corresponding key (as used in fields()).
233 * Array(string $name => string $uniqueName).
235 public static function &fieldKeys() {
236 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
237 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
239 return Civi
::$statics[__CLASS__
]['fieldKeys'];
243 * Returns the names of this table
247 public static function getTableName() {
248 return self
::$_tableName;
252 * Returns if this table needs to be logged
256 public function getLog() {
261 * Returns the list of fields that can be imported
263 * @param bool $prefix
267 public static function &import($prefix = FALSE) {
268 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'domain', $prefix, []);
273 * Returns the list of fields that can be exported
275 * @param bool $prefix
279 public static function &export($prefix = FALSE) {
280 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'domain', $prefix, []);
285 * Returns the list of indices
287 * @param bool $localize
291 public static function indices($localize = TRUE) {
298 'localizable' => FALSE,
300 'sig' => 'civicrm_domain::1::name',
303 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;