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:f077b55105d6cbc918a1beddb158fe7d)
13 * Database access object for the Worldregion entity.
15 class CRM_Core_DAO_Worldregion
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_worldregion';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Region name to be associated with countries
48 public function __construct() {
49 $this->__table
= 'civicrm_worldregion';
50 parent
::__construct();
54 * Returns localized title of this entity.
56 public static function getEntityTitle() {
57 return ts('Worldregions');
61 * Returns all the column names of this table
65 public static function &fields() {
66 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
67 Civi
::$statics[__CLASS__
]['fields'] = [
70 'type' => CRM_Utils_Type
::T_INT
,
71 'title' => ts('World Region ID'),
72 'description' => ts('Country Id'),
74 'where' => 'civicrm_worldregion.id',
75 'table_name' => 'civicrm_worldregion',
76 'entity' => 'Worldregion',
77 'bao' => 'CRM_Core_DAO_Worldregion',
82 'type' => CRM_Utils_Type
::T_STRING
,
83 'title' => ts('World Region'),
84 'description' => ts('Region name to be associated with countries'),
86 'size' => CRM_Utils_Type
::HUGE
,
87 'where' => 'civicrm_worldregion.name',
89 'table_name' => 'civicrm_worldregion',
90 'entity' => 'Worldregion',
91 'bao' => 'CRM_Core_DAO_Worldregion',
95 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
97 return Civi
::$statics[__CLASS__
]['fields'];
101 * Return a mapping from field-name to the corresponding key (as used in fields()).
104 * Array(string $name => string $uniqueName).
106 public static function &fieldKeys() {
107 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
108 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
110 return Civi
::$statics[__CLASS__
]['fieldKeys'];
114 * Returns the names of this table
118 public static function getTableName() {
119 return self
::$_tableName;
123 * Returns if this table needs to be logged
127 public function getLog() {
132 * Returns the list of fields that can be imported
134 * @param bool $prefix
138 public static function &import($prefix = FALSE) {
139 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'worldregion', $prefix, []);
144 * Returns the list of fields that can be exported
146 * @param bool $prefix
150 public static function &export($prefix = FALSE) {
151 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'worldregion', $prefix, []);
156 * Returns the list of indices
158 * @param bool $localize
162 public static function indices($localize = TRUE) {
164 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;