Merge pull request #13241 from seamuslee001/561_schedule_reminders
[civicrm-core.git] / CRM / Core / DAO / Worldregion.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Core/Worldregion.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:f326bc6047454a630b352baf190b0cac)
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 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 static $_log = FALSE;
30
31 /**
32 * Country Id
33 *
34 * @var int unsigned
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 all the column names of this table
55 *
56 * @return array
57 */
58 public static function &fields() {
59 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
60 Civi::$statics[__CLASS__]['fields'] = [
61 'id' => [
62 'name' => 'id',
63 'type' => CRM_Utils_Type::T_INT,
64 'title' => ts('World Region ID'),
65 'description' => ts('Country Id'),
66 'required' => TRUE,
67 'table_name' => 'civicrm_worldregion',
68 'entity' => 'Worldregion',
69 'bao' => 'CRM_Core_DAO_Worldregion',
70 'localizable' => 0,
71 ],
72 'world_region' => [
73 'name' => 'name',
74 'type' => CRM_Utils_Type::T_STRING,
75 'title' => ts('World Region'),
76 'description' => ts('Region name to be associated with countries'),
77 'maxlength' => 128,
78 'size' => CRM_Utils_Type::HUGE,
79 'export' => TRUE,
80 'where' => 'civicrm_worldregion.name',
81 'headerPattern' => '',
82 'dataPattern' => '',
83 'table_name' => 'civicrm_worldregion',
84 'entity' => 'Worldregion',
85 'bao' => 'CRM_Core_DAO_Worldregion',
86 'localizable' => 0,
87 ],
88 ];
89 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
90 }
91 return Civi::$statics[__CLASS__]['fields'];
92 }
93
94 /**
95 * Return a mapping from field-name to the corresponding key (as used in fields()).
96 *
97 * @return array
98 * Array(string $name => string $uniqueName).
99 */
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()));
103 }
104 return Civi::$statics[__CLASS__]['fieldKeys'];
105 }
106
107 /**
108 * Returns the names of this table
109 *
110 * @return string
111 */
112 public static function getTableName() {
113 return self::$_tableName;
114 }
115
116 /**
117 * Returns if this table needs to be logged
118 *
119 * @return bool
120 */
121 public function getLog() {
122 return self::$_log;
123 }
124
125 /**
126 * Returns the list of fields that can be imported
127 *
128 * @param bool $prefix
129 *
130 * @return array
131 */
132 public static function &import($prefix = FALSE) {
133 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'worldregion', $prefix, []);
134 return $r;
135 }
136
137 /**
138 * Returns the list of fields that can be exported
139 *
140 * @param bool $prefix
141 *
142 * @return array
143 */
144 public static function &export($prefix = FALSE) {
145 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'worldregion', $prefix, []);
146 return $r;
147 }
148
149 /**
150 * Returns the list of indices
151 *
152 * @param bool $localize
153 *
154 * @return array
155 */
156 public static function indices($localize = TRUE) {
157 $indices = [];
158 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
159 }
160
161 }