5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Worldregion.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:e8b2ad34381b7a644a5ea7e70cebf27e)
13 * Database access object for the Worldregion entity.
15 class CRM_Core_DAO_Worldregion
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.8';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_worldregion';
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 * Region name to be associated with countries
46 * (SQL type: varchar(128))
47 * Note that values will be retrieved from the database as a string.
54 public function __construct() {
55 $this->__table
= 'civicrm_worldregion';
56 parent
::__construct();
60 * Returns localized title of this entity.
63 * Whether to return the plural version of the title.
65 public static function getEntityTitle($plural = FALSE) {
66 return $plural ?
ts('Worldregions') : ts('Worldregion');
70 * Returns all the column names of this table
74 public static function &fields() {
75 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
76 Civi
::$statics[__CLASS__
]['fields'] = [
79 'type' => CRM_Utils_Type
::T_INT
,
80 'title' => ts('World Region ID'),
81 'description' => ts('Country ID'),
83 'where' => 'civicrm_worldregion.id',
84 'table_name' => 'civicrm_worldregion',
85 'entity' => 'Worldregion',
86 'bao' => 'CRM_Core_DAO_Worldregion',
96 'type' => CRM_Utils_Type
::T_STRING
,
97 'title' => ts('World Region'),
98 'description' => ts('Region name to be associated with countries'),
100 'size' => CRM_Utils_Type
::HUGE
,
101 'where' => 'civicrm_worldregion.name',
103 'table_name' => 'civicrm_worldregion',
104 'entity' => 'Worldregion',
105 'bao' => 'CRM_Core_DAO_Worldregion',
110 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
112 return Civi
::$statics[__CLASS__
]['fields'];
116 * Return a mapping from field-name to the corresponding key (as used in fields()).
119 * Array(string $name => string $uniqueName).
121 public static function &fieldKeys() {
122 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
123 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
125 return Civi
::$statics[__CLASS__
]['fieldKeys'];
129 * Returns the names of this table
133 public static function getTableName() {
134 return self
::$_tableName;
138 * Returns if this table needs to be logged
142 public function getLog() {
147 * Returns the list of fields that can be imported
149 * @param bool $prefix
153 public static function &import($prefix = FALSE) {
154 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'worldregion', $prefix, []);
159 * Returns the list of fields that can be exported
161 * @param bool $prefix
165 public static function &export($prefix = FALSE) {
166 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'worldregion', $prefix, []);
171 * Returns the list of indices
173 * @param bool $localize
177 public static function indices($localize = TRUE) {
179 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;