Merge pull request #22631 from braders/calculateBaseScheduleDate-docblock
[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:e8b2ad34381b7a644a5ea7e70cebf27e)
10 */
11
12 /**
13 * Database access object for the Worldregion entity.
14 */
15 class CRM_Core_DAO_Worldregion extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '1.8';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_worldregion';
25
26 /**
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
28 *
29 * @var bool
30 */
31 public static $_log = FALSE;
32
33 /**
34 * Country ID
35 *
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
39 */
40 public $id;
41
42 /**
43 * Region name to be associated with countries
44 *
45 * @var string|null
46 * (SQL type: varchar(128))
47 * Note that values will be retrieved from the database as a string.
48 */
49 public $name;
50
51 /**
52 * Class constructor.
53 */
54 public function __construct() {
55 $this->__table = 'civicrm_worldregion';
56 parent::__construct();
57 }
58
59 /**
60 * Returns localized title of this entity.
61 *
62 * @param bool $plural
63 * Whether to return the plural version of the title.
64 */
65 public static function getEntityTitle($plural = FALSE) {
66 return $plural ? ts('Worldregions') : ts('Worldregion');
67 }
68
69 /**
70 * Returns all the column names of this table
71 *
72 * @return array
73 */
74 public static function &fields() {
75 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
76 Civi::$statics[__CLASS__]['fields'] = [
77 'id' => [
78 'name' => 'id',
79 'type' => CRM_Utils_Type::T_INT,
80 'title' => ts('World Region ID'),
81 'description' => ts('Country ID'),
82 'required' => TRUE,
83 'where' => 'civicrm_worldregion.id',
84 'table_name' => 'civicrm_worldregion',
85 'entity' => 'Worldregion',
86 'bao' => 'CRM_Core_DAO_Worldregion',
87 'localizable' => 0,
88 'html' => [
89 'type' => 'Number',
90 ],
91 'readonly' => TRUE,
92 'add' => '1.8',
93 ],
94 'world_region' => [
95 'name' => 'name',
96 'type' => CRM_Utils_Type::T_STRING,
97 'title' => ts('World Region'),
98 'description' => ts('Region name to be associated with countries'),
99 'maxlength' => 128,
100 'size' => CRM_Utils_Type::HUGE,
101 'where' => 'civicrm_worldregion.name',
102 'export' => TRUE,
103 'table_name' => 'civicrm_worldregion',
104 'entity' => 'Worldregion',
105 'bao' => 'CRM_Core_DAO_Worldregion',
106 'localizable' => 0,
107 'add' => '1.8',
108 ],
109 ];
110 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
111 }
112 return Civi::$statics[__CLASS__]['fields'];
113 }
114
115 /**
116 * Return a mapping from field-name to the corresponding key (as used in fields()).
117 *
118 * @return array
119 * Array(string $name => string $uniqueName).
120 */
121 public static function &fieldKeys() {
122 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
123 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
124 }
125 return Civi::$statics[__CLASS__]['fieldKeys'];
126 }
127
128 /**
129 * Returns the names of this table
130 *
131 * @return string
132 */
133 public static function getTableName() {
134 return self::$_tableName;
135 }
136
137 /**
138 * Returns if this table needs to be logged
139 *
140 * @return bool
141 */
142 public function getLog() {
143 return self::$_log;
144 }
145
146 /**
147 * Returns the list of fields that can be imported
148 *
149 * @param bool $prefix
150 *
151 * @return array
152 */
153 public static function &import($prefix = FALSE) {
154 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'worldregion', $prefix, []);
155 return $r;
156 }
157
158 /**
159 * Returns the list of fields that can be exported
160 *
161 * @param bool $prefix
162 *
163 * @return array
164 */
165 public static function &export($prefix = FALSE) {
166 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'worldregion', $prefix, []);
167 return $r;
168 }
169
170 /**
171 * Returns the list of indices
172 *
173 * @param bool $localize
174 *
175 * @return array
176 */
177 public static function indices($localize = TRUE) {
178 $indices = [];
179 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
180 }
181
182 }