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