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:941a0821b88a9225d9672cc25daa16f7)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * Name of Domain / Organization
46 * (SQL type: varchar(64))
47 * Note that values will be retrieved from the database as a string.
52 * Description of Domain.
55 * (SQL type: varchar(255))
56 * Note that values will be retrieved from the database as a string.
61 * The civicrm version this instance is running
64 * (SQL type: varchar(32))
65 * Note that values will be retrieved from the database as a string.
70 * FK to Contact ID. This is specifically not an FK to avoid circular constraints
72 * @var int|string|null
73 * (SQL type: int unsigned)
74 * Note that values will be retrieved from the database as a string.
79 * list of locales supported by the current db state (NULL for single-lang install)
83 * Note that values will be retrieved from the database as a string.
88 * Locale specific string overrides
92 * Note that values will be retrieved from the database as a string.
94 public $locale_custom_strings;
99 public function __construct() {
100 $this->__table
= 'civicrm_domain';
101 parent
::__construct();
105 * Returns localized title of this entity.
107 * @param bool $plural
108 * Whether to return the plural version of the title.
110 public static function getEntityTitle($plural = FALSE) {
111 return $plural ?
ts('Domains') : ts('Domain');
115 * Returns foreign keys and entity references.
118 * [CRM_Core_Reference_Interface]
120 public static function getReferenceColumns() {
121 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
122 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
123 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
124 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
126 return Civi
::$statics[__CLASS__
]['links'];
130 * Returns all the column names of this table
134 public static function &fields() {
135 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
136 Civi
::$statics[__CLASS__
]['fields'] = [
139 'type' => CRM_Utils_Type
::T_INT
,
140 'title' => ts('Domain ID'),
141 'description' => ts('Domain ID'),
143 'where' => 'civicrm_domain.id',
144 'table_name' => 'civicrm_domain',
145 'entity' => 'Domain',
146 'bao' => 'CRM_Core_BAO_Domain',
156 'type' => CRM_Utils_Type
::T_STRING
,
157 'title' => ts('Domain Name'),
158 'description' => ts('Name of Domain / Organization'),
160 'size' => CRM_Utils_Type
::BIG
,
161 'where' => 'civicrm_domain.name',
162 'table_name' => 'civicrm_domain',
163 'entity' => 'Domain',
164 'bao' => 'CRM_Core_BAO_Domain',
172 'name' => 'description',
173 'type' => CRM_Utils_Type
::T_STRING
,
174 'title' => ts('Domain Description'),
175 'description' => ts('Description of Domain.'),
177 'size' => CRM_Utils_Type
::HUGE
,
178 'where' => 'civicrm_domain.description',
179 'table_name' => 'civicrm_domain',
180 'entity' => 'Domain',
181 'bao' => 'CRM_Core_BAO_Domain',
190 'type' => CRM_Utils_Type
::T_STRING
,
191 'title' => ts('CiviCRM Version'),
192 'description' => ts('The civicrm version this instance is running'),
194 'size' => CRM_Utils_Type
::MEDIUM
,
195 'where' => 'civicrm_domain.version',
196 'table_name' => 'civicrm_domain',
197 'entity' => 'Domain',
198 'bao' => 'CRM_Core_BAO_Domain',
203 'name' => 'contact_id',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Contact ID'),
206 'description' => ts('FK to Contact ID. This is specifically not an FK to avoid circular constraints'),
207 'where' => 'civicrm_domain.contact_id',
208 'table_name' => 'civicrm_domain',
209 'entity' => 'Domain',
210 'bao' => 'CRM_Core_BAO_Domain',
212 'FKClassName' => 'CRM_Contact_DAO_Contact',
214 'label' => ts("Contact"),
220 'type' => CRM_Utils_Type
::T_TEXT
,
221 'title' => ts('Supported Languages'),
222 'description' => ts('list of locales supported by the current db state (NULL for single-lang install)'),
223 'where' => 'civicrm_domain.locales',
224 'table_name' => 'civicrm_domain',
225 'entity' => 'Domain',
226 'bao' => 'CRM_Core_BAO_Domain',
228 'serialize' => self
::SERIALIZE_SEPARATOR_TRIMMED
,
231 'locale_custom_strings' => [
232 'name' => 'locale_custom_strings',
233 'type' => CRM_Utils_Type
::T_TEXT
,
234 'title' => ts('Language Customizations'),
235 'description' => ts('Locale specific string overrides'),
236 'where' => 'civicrm_domain.locale_custom_strings',
237 'table_name' => 'civicrm_domain',
238 'entity' => 'Domain',
239 'bao' => 'CRM_Core_BAO_Domain',
241 'serialize' => self
::SERIALIZE_PHP
,
245 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
247 return Civi
::$statics[__CLASS__
]['fields'];
251 * Return a mapping from field-name to the corresponding key (as used in fields()).
254 * Array(string $name => string $uniqueName).
256 public static function &fieldKeys() {
257 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
258 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
260 return Civi
::$statics[__CLASS__
]['fieldKeys'];
264 * Returns the names of this table
268 public static function getTableName() {
269 return self
::$_tableName;
273 * Returns if this table needs to be logged
277 public function getLog() {
282 * Returns the list of fields that can be imported
284 * @param bool $prefix
288 public static function &import($prefix = FALSE) {
289 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'domain', $prefix, []);
294 * Returns the list of fields that can be exported
296 * @param bool $prefix
300 public static function &export($prefix = FALSE) {
301 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'domain', $prefix, []);
306 * Returns the list of indices
308 * @param bool $localize
312 public static function indices($localize = TRUE) {
319 'localizable' => FALSE,
321 'sig' => 'civicrm_domain::1::name',
324 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;