5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/Worldregion.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6dd4c29dfca409c7cd7a735836abd202)
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 static $_tableName = 'civicrm_worldregion';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_worldregion',
68 'entity' => 'Worldregion',
69 'bao' => 'CRM_Core_DAO_Worldregion',
74 'type' => CRM_Utils_Type
::T_STRING
,
75 'title' => ts('World Region'),
76 'description' => ts('Region name to be associated with countries'),
78 'size' => CRM_Utils_Type
::HUGE
,
80 'where' => 'civicrm_worldregion.name',
81 'headerPattern' => '',
83 'table_name' => 'civicrm_worldregion',
84 'entity' => 'Worldregion',
85 'bao' => 'CRM_Core_DAO_Worldregion',
89 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
91 return Civi
::$statics[__CLASS__
]['fields'];
95 * Return a mapping from field-name to the corresponding key (as used in fields()).
98 * Array(string $name => string $uniqueName).
100 public static function &fieldKeys() {
101 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
102 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
104 return Civi
::$statics[__CLASS__
]['fieldKeys'];
108 * Returns the names of this table
112 public static function getTableName() {
113 return self
::$_tableName;
117 * Returns if this table needs to be logged
121 public function getLog() {
126 * Returns the list of fields that can be imported
128 * @param bool $prefix
132 public static function &import($prefix = FALSE) {
133 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'worldregion', $prefix, []);
138 * Returns the list of fields that can be exported
140 * @param bool $prefix
144 public static function &export($prefix = FALSE) {
145 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'worldregion', $prefix, []);
150 * Returns the list of indices
152 * @param bool $localize
156 public static function indices($localize = TRUE) {
158 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;