Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
f299f7db | 5 | * @copyright CiviCRM LLC (c) 2004-2020 |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Core/Navigation.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
74db51d3 | 9 | * (GenCodeChecksum:ab8ed383a2b4fe3120d6ea52b18b4e6d) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Navigation entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Core_DAO_Navigation extends CRM_Core_DAO { |
c3fc2621 | 16 | |
e501603b | 17 | /** |
f41f0342 | 18 | * Static instance to hold the table name. |
e501603b TO |
19 | * |
20 | * @var string | |
21 | */ | |
fa45b5b9 | 22 | public static $_tableName = 'civicrm_navigation'; |
c3fc2621 | 23 | |
e501603b | 24 | /** |
f41f0342 | 25 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 26 | * |
c3fc2621 | 27 | * @var bool |
e501603b | 28 | */ |
fa45b5b9 | 29 | public static $_log = FALSE; |
c3fc2621 | 30 | |
e501603b | 31 | /** |
e6ca0a57 | 32 | * @var int |
e501603b TO |
33 | */ |
34 | public $id; | |
c3fc2621 | 35 | |
e501603b TO |
36 | /** |
37 | * Which Domain is this navigation item for | |
38 | * | |
e6ca0a57 | 39 | * @var int |
e501603b TO |
40 | */ |
41 | public $domain_id; | |
c3fc2621 | 42 | |
e501603b TO |
43 | /** |
44 | * Navigation Title | |
45 | * | |
46 | * @var string | |
47 | */ | |
48 | public $label; | |
c3fc2621 | 49 | |
e501603b TO |
50 | /** |
51 | * Internal Name | |
52 | * | |
53 | * @var string | |
54 | */ | |
55 | public $name; | |
c3fc2621 | 56 | |
e501603b TO |
57 | /** |
58 | * url in case of custom navigation link | |
59 | * | |
60 | * @var string | |
61 | */ | |
62 | public $url; | |
c3fc2621 | 63 | |
4926ede8 O |
64 | /** |
65 | * CSS class name for an icon | |
66 | * | |
67 | * @var string | |
68 | */ | |
69 | public $icon; | |
c3fc2621 | 70 | |
e501603b TO |
71 | /** |
72 | * Permission for menu item | |
73 | * | |
74 | * @var string | |
75 | */ | |
76 | public $permission; | |
c3fc2621 | 77 | |
e501603b TO |
78 | /** |
79 | * Permission Operator | |
80 | * | |
81 | * @var string | |
82 | */ | |
83 | public $permission_operator; | |
c3fc2621 | 84 | |
e501603b TO |
85 | /** |
86 | * Parent navigation item, used for grouping | |
87 | * | |
e6ca0a57 | 88 | * @var int |
e501603b TO |
89 | */ |
90 | public $parent_id; | |
c3fc2621 | 91 | |
e501603b TO |
92 | /** |
93 | * Is this navigation item active? | |
94 | * | |
e6ca0a57 | 95 | * @var bool |
e501603b TO |
96 | */ |
97 | public $is_active; | |
c3fc2621 | 98 | |
e501603b TO |
99 | /** |
100 | * If separator needs to be added after this menu item | |
101 | * | |
e6ca0a57 | 102 | * @var bool |
e501603b TO |
103 | */ |
104 | public $has_separator; | |
c3fc2621 | 105 | |
e501603b TO |
106 | /** |
107 | * Ordering of the navigation items in various blocks. | |
108 | * | |
109 | * @var int | |
110 | */ | |
111 | public $weight; | |
c3fc2621 | 112 | |
e501603b | 113 | /** |
f41f0342 | 114 | * Class constructor. |
e501603b | 115 | */ |
c3fc2621 | 116 | public function __construct() { |
e501603b TO |
117 | $this->__table = 'civicrm_navigation'; |
118 | parent::__construct(); | |
119 | } | |
c3fc2621 | 120 | |
e501603b | 121 | /** |
f41f0342 | 122 | * Returns foreign keys and entity references. |
e501603b TO |
123 | * |
124 | * @return array | |
125 | * [CRM_Core_Reference_Interface] | |
126 | */ | |
c3fc2621 | 127 | public static function getReferenceColumns() { |
346aaaba | 128 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 129 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
130 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id'); |
131 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'parent_id', 'civicrm_navigation', 'id'); | |
346aaaba | 132 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 133 | } |
346aaaba | 134 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 135 | } |
c3fc2621 | 136 | |
e501603b TO |
137 | /** |
138 | * Returns all the column names of this table | |
139 | * | |
140 | * @return array | |
141 | */ | |
c3fc2621 | 142 | public static function &fields() { |
346aaaba | 143 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
144 | Civi::$statics[__CLASS__]['fields'] = [ |
145 | 'id' => [ | |
e501603b TO |
146 | 'name' => 'id', |
147 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
148 | 'title' => ts('Navigation ID'), |
149 | 'required' => TRUE, | |
a36434b9 | 150 | 'where' => 'civicrm_navigation.id', |
522a26c9 | 151 | 'table_name' => 'civicrm_navigation', |
152 | 'entity' => 'Navigation', | |
153 | 'bao' => 'CRM_Core_BAO_Navigation', | |
6a7e5e5d | 154 | 'localizable' => 0, |
c3fc2621 CW |
155 | ], |
156 | 'domain_id' => [ | |
e501603b TO |
157 | 'name' => 'domain_id', |
158 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 159 | 'title' => ts('Navigation Domain'), |
215b423e | 160 | 'description' => ts('Which Domain is this navigation item for'), |
c3fc2621 | 161 | 'required' => TRUE, |
a36434b9 | 162 | 'where' => 'civicrm_navigation.domain_id', |
522a26c9 | 163 | 'table_name' => 'civicrm_navigation', |
164 | 'entity' => 'Navigation', | |
165 | 'bao' => 'CRM_Core_BAO_Navigation', | |
6a7e5e5d | 166 | 'localizable' => 0, |
e501603b | 167 | 'FKClassName' => 'CRM_Core_DAO_Domain', |
c3fc2621 | 168 | 'pseudoconstant' => [ |
e501603b TO |
169 | 'table' => 'civicrm_domain', |
170 | 'keyColumn' => 'id', | |
171 | 'labelColumn' => 'name', | |
e6ca0a57 | 172 | ], |
c3fc2621 CW |
173 | ], |
174 | 'label' => [ | |
e501603b TO |
175 | 'name' => 'label', |
176 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 177 | 'title' => ts('Navigation Item Label'), |
215b423e | 178 | 'description' => ts('Navigation Title'), |
e501603b TO |
179 | 'maxlength' => 255, |
180 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 181 | 'where' => 'civicrm_navigation.label', |
522a26c9 | 182 | 'table_name' => 'civicrm_navigation', |
183 | 'entity' => 'Navigation', | |
184 | 'bao' => 'CRM_Core_BAO_Navigation', | |
6a7e5e5d | 185 | 'localizable' => 0, |
c3fc2621 CW |
186 | ], |
187 | 'name' => [ | |
e501603b TO |
188 | 'name' => 'name', |
189 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 190 | 'title' => ts('Navigation Item Machine Name'), |
215b423e | 191 | 'description' => ts('Internal Name'), |
e501603b TO |
192 | 'maxlength' => 255, |
193 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 194 | 'where' => 'civicrm_navigation.name', |
522a26c9 | 195 | 'table_name' => 'civicrm_navigation', |
196 | 'entity' => 'Navigation', | |
197 | 'bao' => 'CRM_Core_BAO_Navigation', | |
6a7e5e5d | 198 | 'localizable' => 0, |
c3fc2621 CW |
199 | ], |
200 | 'url' => [ | |
e501603b TO |
201 | 'name' => 'url', |
202 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 203 | 'title' => ts('Url'), |
215b423e | 204 | 'description' => ts('url in case of custom navigation link'), |
e501603b TO |
205 | 'maxlength' => 255, |
206 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 207 | 'where' => 'civicrm_navigation.url', |
522a26c9 | 208 | 'table_name' => 'civicrm_navigation', |
209 | 'entity' => 'Navigation', | |
210 | 'bao' => 'CRM_Core_BAO_Navigation', | |
6a7e5e5d | 211 | 'localizable' => 0, |
c3fc2621 CW |
212 | ], |
213 | 'icon' => [ | |
4926ede8 O |
214 | 'name' => 'icon', |
215 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 216 | 'title' => ts('Icon'), |
215b423e | 217 | 'description' => ts('CSS class name for an icon'), |
c3fc2621 | 218 | 'required' => FALSE, |
4926ede8 O |
219 | 'maxlength' => 255, |
220 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 221 | 'where' => 'civicrm_navigation.icon', |
4926ede8 O |
222 | 'default' => 'NULL', |
223 | 'table_name' => 'civicrm_navigation', | |
224 | 'entity' => 'Navigation', | |
225 | 'bao' => 'CRM_Core_BAO_Navigation', | |
226 | 'localizable' => 0, | |
c3fc2621 CW |
227 | ], |
228 | 'permission' => [ | |
e501603b TO |
229 | 'name' => 'permission', |
230 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 231 | 'title' => ts('Required Permission'), |
215b423e | 232 | 'description' => ts('Permission for menu item'), |
e501603b TO |
233 | 'maxlength' => 255, |
234 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 235 | 'where' => 'civicrm_navigation.permission', |
522a26c9 | 236 | 'table_name' => 'civicrm_navigation', |
237 | 'entity' => 'Navigation', | |
238 | 'bao' => 'CRM_Core_BAO_Navigation', | |
6a7e5e5d | 239 | 'localizable' => 0, |
c3fc2621 CW |
240 | ], |
241 | 'permission_operator' => [ | |
e501603b TO |
242 | 'name' => 'permission_operator', |
243 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 244 | 'title' => ts('Permission Operator'), |
215b423e | 245 | 'description' => ts('Permission Operator'), |
e501603b TO |
246 | 'maxlength' => 3, |
247 | 'size' => CRM_Utils_Type::FOUR, | |
a36434b9 | 248 | 'where' => 'civicrm_navigation.permission_operator', |
522a26c9 | 249 | 'table_name' => 'civicrm_navigation', |
250 | 'entity' => 'Navigation', | |
251 | 'bao' => 'CRM_Core_BAO_Navigation', | |
6a7e5e5d | 252 | 'localizable' => 0, |
c3fc2621 CW |
253 | ], |
254 | 'parent_id' => [ | |
e501603b TO |
255 | 'name' => 'parent_id', |
256 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 257 | 'title' => ts('Navigation parent ID'), |
215b423e | 258 | 'description' => ts('Parent navigation item, used for grouping'), |
a36434b9 | 259 | 'where' => 'civicrm_navigation.parent_id', |
522a26c9 | 260 | 'table_name' => 'civicrm_navigation', |
261 | 'entity' => 'Navigation', | |
262 | 'bao' => 'CRM_Core_BAO_Navigation', | |
6a7e5e5d | 263 | 'localizable' => 0, |
e501603b | 264 | 'FKClassName' => 'CRM_Core_DAO_Navigation', |
c3fc2621 | 265 | 'pseudoconstant' => [ |
e501603b | 266 | 'table' => 'civicrm_navigation', |
e2c44ec0 | 267 | 'keyColumn' => 'id', |
e501603b | 268 | 'labelColumn' => 'label', |
e2c44ec0 | 269 | 'nameColumn' => 'name', |
e6ca0a57 | 270 | ], |
c3fc2621 CW |
271 | ], |
272 | 'is_active' => [ | |
e501603b TO |
273 | 'name' => 'is_active', |
274 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 275 | 'title' => ts('Is Active'), |
215b423e | 276 | 'description' => ts('Is this navigation item active?'), |
a36434b9 | 277 | 'where' => 'civicrm_navigation.is_active', |
522a26c9 | 278 | 'table_name' => 'civicrm_navigation', |
279 | 'entity' => 'Navigation', | |
280 | 'bao' => 'CRM_Core_BAO_Navigation', | |
6a7e5e5d | 281 | 'localizable' => 0, |
c3fc2621 CW |
282 | ], |
283 | 'has_separator' => [ | |
e501603b TO |
284 | 'name' => 'has_separator', |
285 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 286 | 'title' => ts('Use separator'), |
215b423e | 287 | 'description' => ts('If separator needs to be added after this menu item'), |
a36434b9 | 288 | 'where' => 'civicrm_navigation.has_separator', |
522a26c9 | 289 | 'table_name' => 'civicrm_navigation', |
290 | 'entity' => 'Navigation', | |
291 | 'bao' => 'CRM_Core_BAO_Navigation', | |
6a7e5e5d | 292 | 'localizable' => 0, |
c3fc2621 CW |
293 | ], |
294 | 'weight' => [ | |
e501603b TO |
295 | 'name' => 'weight', |
296 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 297 | 'title' => ts('Order'), |
215b423e | 298 | 'description' => ts('Ordering of the navigation items in various blocks.'), |
a36434b9 | 299 | 'where' => 'civicrm_navigation.weight', |
522a26c9 | 300 | 'table_name' => 'civicrm_navigation', |
301 | 'entity' => 'Navigation', | |
302 | 'bao' => 'CRM_Core_BAO_Navigation', | |
6a7e5e5d | 303 | 'localizable' => 0, |
c3fc2621 CW |
304 | ], |
305 | ]; | |
346aaaba | 306 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 307 | } |
346aaaba | 308 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 309 | } |
c3fc2621 | 310 | |
e501603b | 311 | /** |
bd8e0b14 | 312 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
313 | * |
314 | * @return array | |
bd8e0b14 | 315 | * Array(string $name => string $uniqueName). |
e501603b | 316 | */ |
c3fc2621 | 317 | public static function &fieldKeys() { |
bd8e0b14 TO |
318 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
319 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 320 | } |
bd8e0b14 | 321 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 322 | } |
c3fc2621 | 323 | |
e501603b TO |
324 | /** |
325 | * Returns the names of this table | |
326 | * | |
327 | * @return string | |
328 | */ | |
c3fc2621 | 329 | public static function getTableName() { |
e501603b TO |
330 | return self::$_tableName; |
331 | } | |
c3fc2621 | 332 | |
e501603b TO |
333 | /** |
334 | * Returns if this table needs to be logged | |
335 | * | |
c3fc2621 | 336 | * @return bool |
e501603b | 337 | */ |
c3fc2621 | 338 | public function getLog() { |
e501603b TO |
339 | return self::$_log; |
340 | } | |
c3fc2621 | 341 | |
e501603b TO |
342 | /** |
343 | * Returns the list of fields that can be imported | |
344 | * | |
345 | * @param bool $prefix | |
346 | * | |
347 | * @return array | |
348 | */ | |
c3fc2621 CW |
349 | public static function &import($prefix = FALSE) { |
350 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'navigation', $prefix, []); | |
60808919 | 351 | return $r; |
e501603b | 352 | } |
c3fc2621 | 353 | |
e501603b TO |
354 | /** |
355 | * Returns the list of fields that can be exported | |
356 | * | |
357 | * @param bool $prefix | |
358 | * | |
359 | * @return array | |
360 | */ | |
c3fc2621 CW |
361 | public static function &export($prefix = FALSE) { |
362 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'navigation', $prefix, []); | |
60808919 | 363 | return $r; |
e501603b | 364 | } |
c3fc2621 | 365 | |
e7a6b91a AS |
366 | /** |
367 | * Returns the list of indices | |
c3fc2621 CW |
368 | * |
369 | * @param bool $localize | |
370 | * | |
371 | * @return array | |
e7a6b91a AS |
372 | */ |
373 | public static function indices($localize = TRUE) { | |
c3fc2621 | 374 | $indices = []; |
e7a6b91a AS |
375 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
376 | } | |
c3fc2621 | 377 | |
e501603b | 378 | } |