8b488e59ca5794b53bfc9ae0a3b6a1e71e3ad7e9
[civicrm-core.git] / CRM / Core / DAO / Worldregion.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Core/Worldregion.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:f077b55105d6cbc918a1beddb158fe7d)
10 */
11
12 /**
13 * Database access object for the Worldregion entity.
14 */
15 class CRM_Core_DAO_Worldregion extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_worldregion';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * Country Id
33 *
34 * @var int
35 */
36 public $id;
37
38 /**
39 * Region name to be associated with countries
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * Class constructor.
47 */
48 public function __construct() {
49 $this->__table = 'civicrm_worldregion';
50 parent::__construct();
51 }
52
53 /**
54 * Returns localized title of this entity.
55 */
56 public static function getEntityTitle() {
57 return ts('Worldregions');
58 }
59
60 /**
61 * Returns all the column names of this table
62 *
63 * @return array
64 */
65 public static function &fields() {
66 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
67 Civi::$statics[__CLASS__]['fields'] = [
68 'id' => [
69 'name' => 'id',
70 'type' => CRM_Utils_Type::T_INT,
71 'title' => ts('World Region ID'),
72 'description' => ts('Country Id'),
73 'required' => TRUE,
74 'where' => 'civicrm_worldregion.id',
75 'table_name' => 'civicrm_worldregion',
76 'entity' => 'Worldregion',
77 'bao' => 'CRM_Core_DAO_Worldregion',
78 'localizable' => 0,
79 ],
80 'world_region' => [
81 'name' => 'name',
82 'type' => CRM_Utils_Type::T_STRING,
83 'title' => ts('World Region'),
84 'description' => ts('Region name to be associated with countries'),
85 'maxlength' => 128,
86 'size' => CRM_Utils_Type::HUGE,
87 'where' => 'civicrm_worldregion.name',
88 'export' => TRUE,
89 'table_name' => 'civicrm_worldregion',
90 'entity' => 'Worldregion',
91 'bao' => 'CRM_Core_DAO_Worldregion',
92 'localizable' => 0,
93 ],
94 ];
95 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
96 }
97 return Civi::$statics[__CLASS__]['fields'];
98 }
99
100 /**
101 * Return a mapping from field-name to the corresponding key (as used in fields()).
102 *
103 * @return array
104 * Array(string $name => string $uniqueName).
105 */
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()));
109 }
110 return Civi::$statics[__CLASS__]['fieldKeys'];
111 }
112
113 /**
114 * Returns the names of this table
115 *
116 * @return string
117 */
118 public static function getTableName() {
119 return self::$_tableName;
120 }
121
122 /**
123 * Returns if this table needs to be logged
124 *
125 * @return bool
126 */
127 public function getLog() {
128 return self::$_log;
129 }
130
131 /**
132 * Returns the list of fields that can be imported
133 *
134 * @param bool $prefix
135 *
136 * @return array
137 */
138 public static function &import($prefix = FALSE) {
139 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'worldregion', $prefix, []);
140 return $r;
141 }
142
143 /**
144 * Returns the list of fields that can be exported
145 *
146 * @param bool $prefix
147 *
148 * @return array
149 */
150 public static function &export($prefix = FALSE) {
151 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'worldregion', $prefix, []);
152 return $r;
153 }
154
155 /**
156 * Returns the list of indices
157 *
158 * @param bool $localize
159 *
160 * @return array
161 */
162 public static function indices($localize = TRUE) {
163 $indices = [];
164 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
165 }
166
167 }