5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/Worldregion.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b607c0ba0b25b3f785779384fc6a6887)
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 all the column names of this table
58 public static function &fields() {
59 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
60 Civi
::$statics[__CLASS__
]['fields'] = [
63 'type' => CRM_Utils_Type
::T_INT
,
64 'title' => ts('World Region ID'),
65 'description' => ts('Country Id'),
67 'where' => 'civicrm_worldregion.id',
68 'table_name' => 'civicrm_worldregion',
69 'entity' => 'Worldregion',
70 'bao' => 'CRM_Core_DAO_Worldregion',
75 'type' => CRM_Utils_Type
::T_STRING
,
76 'title' => ts('World Region'),
77 'description' => ts('Region name to be associated with countries'),
79 'size' => CRM_Utils_Type
::HUGE
,
80 'where' => 'civicrm_worldregion.name',
82 'table_name' => 'civicrm_worldregion',
83 'entity' => 'Worldregion',
84 'bao' => 'CRM_Core_DAO_Worldregion',
88 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
90 return Civi
::$statics[__CLASS__
]['fields'];
94 * Return a mapping from field-name to the corresponding key (as used in fields()).
97 * Array(string $name => string $uniqueName).
99 public static function &fieldKeys() {
100 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
101 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
103 return Civi
::$statics[__CLASS__
]['fieldKeys'];
107 * Returns the names of this table
111 public static function getTableName() {
112 return self
::$_tableName;
116 * Returns if this table needs to be logged
120 public function getLog() {
125 * Returns the list of fields that can be imported
127 * @param bool $prefix
131 public static function &import($prefix = FALSE) {
132 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'worldregion', $prefix, []);
137 * Returns the list of fields that can be exported
139 * @param bool $prefix
143 public static function &export($prefix = FALSE) {
144 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'worldregion', $prefix, []);
149 * Returns the list of indices
151 * @param bool $localize
155 public static function indices($localize = TRUE) {
157 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;