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:897ca1a3833baf2e0c5bc09b350d26cd)
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;
41 * Region name to be associated with countries
50 public function __construct() {
51 $this->__table
= 'civicrm_worldregion';
52 parent
::__construct();
56 * Returns localized title of this entity.
59 * Whether to return the plural version of the title.
61 public static function getEntityTitle($plural = FALSE) {
62 return $plural ?
ts('Worldregions') : ts('Worldregion');
66 * Returns all the column names of this table
70 public static function &fields() {
71 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
72 Civi
::$statics[__CLASS__
]['fields'] = [
75 'type' => CRM_Utils_Type
::T_INT
,
76 'title' => ts('World Region ID'),
77 'description' => ts('Country ID'),
79 'where' => 'civicrm_worldregion.id',
80 'table_name' => 'civicrm_worldregion',
81 'entity' => 'Worldregion',
82 'bao' => 'CRM_Core_DAO_Worldregion',
92 'type' => CRM_Utils_Type
::T_STRING
,
93 'title' => ts('World Region'),
94 'description' => ts('Region name to be associated with countries'),
96 'size' => CRM_Utils_Type
::HUGE
,
97 'where' => 'civicrm_worldregion.name',
99 'table_name' => 'civicrm_worldregion',
100 'entity' => 'Worldregion',
101 'bao' => 'CRM_Core_DAO_Worldregion',
106 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
108 return Civi
::$statics[__CLASS__
]['fields'];
112 * Return a mapping from field-name to the corresponding key (as used in fields()).
115 * Array(string $name => string $uniqueName).
117 public static function &fieldKeys() {
118 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
119 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
121 return Civi
::$statics[__CLASS__
]['fieldKeys'];
125 * Returns the names of this table
129 public static function getTableName() {
130 return self
::$_tableName;
134 * Returns if this table needs to be logged
138 public function getLog() {
143 * Returns the list of fields that can be imported
145 * @param bool $prefix
149 public static function &import($prefix = FALSE) {
150 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'worldregion', $prefix, []);
155 * Returns the list of fields that can be exported
157 * @param bool $prefix
161 public static function &export($prefix = FALSE) {
162 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'worldregion', $prefix, []);
167 * Returns the list of indices
169 * @param bool $localize
173 public static function indices($localize = TRUE) {
175 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;