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:bc0230cdd003ef494022c8d78486656e)
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',
88 'type' => CRM_Utils_Type
::T_STRING
,
89 'title' => ts('World Region'),
90 'description' => ts('Region name to be associated with countries'),
92 'size' => CRM_Utils_Type
::HUGE
,
93 'where' => 'civicrm_worldregion.name',
95 'table_name' => 'civicrm_worldregion',
96 'entity' => 'Worldregion',
97 'bao' => 'CRM_Core_DAO_Worldregion',
102 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
104 return Civi
::$statics[__CLASS__
]['fields'];
108 * Return a mapping from field-name to the corresponding key (as used in fields()).
111 * Array(string $name => string $uniqueName).
113 public static function &fieldKeys() {
114 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
115 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
117 return Civi
::$statics[__CLASS__
]['fieldKeys'];
121 * Returns the names of this table
125 public static function getTableName() {
126 return self
::$_tableName;
130 * Returns if this table needs to be logged
134 public function getLog() {
139 * Returns the list of fields that can be imported
141 * @param bool $prefix
145 public static function &import($prefix = FALSE) {
146 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'worldregion', $prefix, []);
151 * Returns the list of fields that can be exported
153 * @param bool $prefix
157 public static function &export($prefix = FALSE) {
158 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'worldregion', $prefix, []);
163 * Returns the list of indices
165 * @param bool $localize
169 public static function indices($localize = TRUE) {
171 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;