Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
6b83d5bd | 5 | * @copyright CiviCRM LLC (c) 2004-2019 |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Core/Menu.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
e6ca0a57 | 9 | * (GenCodeChecksum:2ba374f38c5906a6338e2c0de34208f6) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Menu entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Core_DAO_Menu 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_menu'; |
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 menu item for | |
38 | * | |
e6ca0a57 | 39 | * @var int |
e501603b TO |
40 | */ |
41 | public $domain_id; | |
c3fc2621 | 42 | |
e501603b TO |
43 | /** |
44 | * Path Name | |
45 | * | |
46 | * @var string | |
47 | */ | |
48 | public $path; | |
c3fc2621 | 49 | |
e501603b TO |
50 | /** |
51 | * Arguments to pass to the url | |
52 | * | |
53 | * @var text | |
54 | */ | |
55 | public $path_arguments; | |
c3fc2621 | 56 | |
e501603b | 57 | /** |
e501603b TO |
58 | * @var string |
59 | */ | |
60 | public $title; | |
c3fc2621 | 61 | |
e501603b TO |
62 | /** |
63 | * Function to call to check access permissions | |
64 | * | |
65 | * @var string | |
66 | */ | |
67 | public $access_callback; | |
c3fc2621 | 68 | |
e501603b TO |
69 | /** |
70 | * Arguments to pass to access callback | |
71 | * | |
72 | * @var text | |
73 | */ | |
74 | public $access_arguments; | |
c3fc2621 | 75 | |
e501603b TO |
76 | /** |
77 | * function to call for this url | |
78 | * | |
79 | * @var string | |
80 | */ | |
81 | public $page_callback; | |
c3fc2621 | 82 | |
e501603b TO |
83 | /** |
84 | * Arguments to pass to page callback | |
85 | * | |
86 | * @var text | |
87 | */ | |
88 | public $page_arguments; | |
c3fc2621 | 89 | |
e501603b TO |
90 | /** |
91 | * Breadcrumb for the path. | |
92 | * | |
93 | * @var text | |
94 | */ | |
95 | public $breadcrumb; | |
c3fc2621 | 96 | |
e501603b TO |
97 | /** |
98 | * Url where a page should redirected to, if next url not known. | |
99 | * | |
100 | * @var string | |
101 | */ | |
102 | public $return_url; | |
c3fc2621 | 103 | |
e501603b TO |
104 | /** |
105 | * Arguments to pass to return_url | |
106 | * | |
107 | * @var string | |
108 | */ | |
109 | public $return_url_args; | |
c3fc2621 | 110 | |
e501603b TO |
111 | /** |
112 | * Component that this menu item belongs to | |
113 | * | |
e6ca0a57 | 114 | * @var int |
e501603b TO |
115 | */ |
116 | public $component_id; | |
c3fc2621 | 117 | |
e501603b TO |
118 | /** |
119 | * Is this menu item active? | |
120 | * | |
e6ca0a57 | 121 | * @var bool |
e501603b TO |
122 | */ |
123 | public $is_active; | |
c3fc2621 | 124 | |
e501603b TO |
125 | /** |
126 | * Is this menu accessible to the public? | |
127 | * | |
e6ca0a57 | 128 | * @var bool |
e501603b TO |
129 | */ |
130 | public $is_public; | |
c3fc2621 | 131 | |
e501603b TO |
132 | /** |
133 | * Is this menu exposed to the navigation system? | |
134 | * | |
e6ca0a57 | 135 | * @var bool |
e501603b TO |
136 | */ |
137 | public $is_exposed; | |
c3fc2621 | 138 | |
e501603b TO |
139 | /** |
140 | * Should this menu be exposed via SSL if enabled? | |
141 | * | |
e6ca0a57 | 142 | * @var bool |
e501603b TO |
143 | */ |
144 | public $is_ssl; | |
c3fc2621 | 145 | |
e501603b TO |
146 | /** |
147 | * Ordering of the menu items in various blocks. | |
148 | * | |
149 | * @var int | |
150 | */ | |
151 | public $weight; | |
c3fc2621 | 152 | |
e501603b TO |
153 | /** |
154 | * Drupal menu type. | |
155 | * | |
156 | * @var int | |
157 | */ | |
158 | public $type; | |
c3fc2621 | 159 | |
e501603b TO |
160 | /** |
161 | * CiviCRM menu type. | |
162 | * | |
163 | * @var int | |
164 | */ | |
165 | public $page_type; | |
c3fc2621 | 166 | |
e501603b TO |
167 | /** |
168 | * skip this url being exposed to breadcrumb | |
169 | * | |
e6ca0a57 | 170 | * @var bool |
e501603b TO |
171 | */ |
172 | public $skipBreadcrumb; | |
c3fc2621 | 173 | |
b44dc91e TO |
174 | /** |
175 | * All other menu metadata not stored in other fields | |
176 | * | |
177 | * @var text | |
178 | */ | |
179 | public $module_data; | |
c3fc2621 | 180 | |
e501603b | 181 | /** |
f41f0342 | 182 | * Class constructor. |
e501603b | 183 | */ |
c3fc2621 | 184 | public function __construct() { |
e501603b TO |
185 | $this->__table = 'civicrm_menu'; |
186 | parent::__construct(); | |
187 | } | |
c3fc2621 | 188 | |
e501603b | 189 | /** |
f41f0342 | 190 | * Returns foreign keys and entity references. |
e501603b TO |
191 | * |
192 | * @return array | |
193 | * [CRM_Core_Reference_Interface] | |
194 | */ | |
c3fc2621 | 195 | public static function getReferenceColumns() { |
346aaaba | 196 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 197 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
198 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id'); |
199 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'component_id', 'civicrm_component', 'id'); | |
346aaaba | 200 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 201 | } |
346aaaba | 202 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 203 | } |
c3fc2621 | 204 | |
e501603b TO |
205 | /** |
206 | * Returns all the column names of this table | |
207 | * | |
208 | * @return array | |
209 | */ | |
c3fc2621 | 210 | public static function &fields() { |
346aaaba | 211 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
212 | Civi::$statics[__CLASS__]['fields'] = [ |
213 | 'id' => [ | |
e501603b TO |
214 | 'name' => 'id', |
215 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
216 | 'title' => ts('Menu ID'), |
217 | 'required' => TRUE, | |
a36434b9 | 218 | 'where' => 'civicrm_menu.id', |
522a26c9 | 219 | 'table_name' => 'civicrm_menu', |
220 | 'entity' => 'Menu', | |
221 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 222 | 'localizable' => 0, |
c3fc2621 CW |
223 | ], |
224 | 'domain_id' => [ | |
e501603b TO |
225 | 'name' => 'domain_id', |
226 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 227 | 'title' => ts('Domain'), |
215b423e | 228 | 'description' => ts('Which Domain is this menu item for'), |
c3fc2621 | 229 | 'required' => TRUE, |
a36434b9 | 230 | 'where' => 'civicrm_menu.domain_id', |
522a26c9 | 231 | 'table_name' => 'civicrm_menu', |
232 | 'entity' => 'Menu', | |
233 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 234 | 'localizable' => 0, |
e501603b | 235 | 'FKClassName' => 'CRM_Core_DAO_Domain', |
c3fc2621 | 236 | 'pseudoconstant' => [ |
e501603b TO |
237 | 'table' => 'civicrm_domain', |
238 | 'keyColumn' => 'id', | |
239 | 'labelColumn' => 'name', | |
e6ca0a57 | 240 | ], |
c3fc2621 CW |
241 | ], |
242 | 'path' => [ | |
e501603b TO |
243 | 'name' => 'path', |
244 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 245 | 'title' => ts('Path'), |
215b423e | 246 | 'description' => ts('Path Name'), |
e501603b TO |
247 | 'maxlength' => 255, |
248 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 249 | 'where' => 'civicrm_menu.path', |
522a26c9 | 250 | 'table_name' => 'civicrm_menu', |
251 | 'entity' => 'Menu', | |
252 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 253 | 'localizable' => 0, |
c3fc2621 CW |
254 | ], |
255 | 'path_arguments' => [ | |
e501603b TO |
256 | 'name' => 'path_arguments', |
257 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 258 | 'title' => ts('Arguments'), |
215b423e | 259 | 'description' => ts('Arguments to pass to the url'), |
a36434b9 | 260 | 'where' => 'civicrm_menu.path_arguments', |
522a26c9 | 261 | 'table_name' => 'civicrm_menu', |
262 | 'entity' => 'Menu', | |
263 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 264 | 'localizable' => 0, |
c3fc2621 CW |
265 | ], |
266 | 'title' => [ | |
e501603b TO |
267 | 'name' => 'title', |
268 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 269 | 'title' => ts('Menu Title'), |
e501603b TO |
270 | 'maxlength' => 255, |
271 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 272 | 'where' => 'civicrm_menu.title', |
522a26c9 | 273 | 'table_name' => 'civicrm_menu', |
274 | 'entity' => 'Menu', | |
275 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 276 | 'localizable' => 0, |
c3fc2621 CW |
277 | ], |
278 | 'access_callback' => [ | |
e501603b TO |
279 | 'name' => 'access_callback', |
280 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 281 | 'title' => ts('Access Callback'), |
215b423e | 282 | 'description' => ts('Function to call to check access permissions'), |
e501603b TO |
283 | 'maxlength' => 255, |
284 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 285 | 'where' => 'civicrm_menu.access_callback', |
522a26c9 | 286 | 'table_name' => 'civicrm_menu', |
287 | 'entity' => 'Menu', | |
288 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 289 | 'localizable' => 0, |
c3fc2621 CW |
290 | ], |
291 | 'access_arguments' => [ | |
e501603b TO |
292 | 'name' => 'access_arguments', |
293 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 294 | 'title' => ts('Access Arguments'), |
215b423e | 295 | 'description' => ts('Arguments to pass to access callback'), |
a36434b9 | 296 | 'where' => 'civicrm_menu.access_arguments', |
522a26c9 | 297 | 'table_name' => 'civicrm_menu', |
298 | 'entity' => 'Menu', | |
299 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 300 | 'localizable' => 0, |
c3fc2621 CW |
301 | ], |
302 | 'page_callback' => [ | |
e501603b TO |
303 | 'name' => 'page_callback', |
304 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 305 | 'title' => ts('Page Callback'), |
215b423e | 306 | 'description' => ts('function to call for this url'), |
e501603b TO |
307 | 'maxlength' => 255, |
308 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 309 | 'where' => 'civicrm_menu.page_callback', |
522a26c9 | 310 | 'table_name' => 'civicrm_menu', |
311 | 'entity' => 'Menu', | |
312 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 313 | 'localizable' => 0, |
c3fc2621 CW |
314 | ], |
315 | 'page_arguments' => [ | |
e501603b TO |
316 | 'name' => 'page_arguments', |
317 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 318 | 'title' => ts('Page Arguments'), |
215b423e | 319 | 'description' => ts('Arguments to pass to page callback'), |
a36434b9 | 320 | 'where' => 'civicrm_menu.page_arguments', |
522a26c9 | 321 | 'table_name' => 'civicrm_menu', |
322 | 'entity' => 'Menu', | |
323 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 324 | 'localizable' => 0, |
c3fc2621 CW |
325 | ], |
326 | 'breadcrumb' => [ | |
e501603b TO |
327 | 'name' => 'breadcrumb', |
328 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 329 | 'title' => ts('Breadcrumb'), |
215b423e | 330 | 'description' => ts('Breadcrumb for the path.'), |
a36434b9 | 331 | 'where' => 'civicrm_menu.breadcrumb', |
522a26c9 | 332 | 'table_name' => 'civicrm_menu', |
333 | 'entity' => 'Menu', | |
334 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 335 | 'localizable' => 0, |
c3fc2621 CW |
336 | ], |
337 | 'return_url' => [ | |
e501603b TO |
338 | 'name' => 'return_url', |
339 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 340 | 'title' => ts('Return Url'), |
215b423e | 341 | 'description' => ts('Url where a page should redirected to, if next url not known.'), |
e501603b TO |
342 | 'maxlength' => 255, |
343 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 344 | 'where' => 'civicrm_menu.return_url', |
522a26c9 | 345 | 'table_name' => 'civicrm_menu', |
346 | 'entity' => 'Menu', | |
347 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 348 | 'localizable' => 0, |
c3fc2621 CW |
349 | ], |
350 | 'return_url_args' => [ | |
e501603b TO |
351 | 'name' => 'return_url_args', |
352 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 353 | 'title' => ts('Return Url Args'), |
215b423e | 354 | 'description' => ts('Arguments to pass to return_url'), |
e501603b TO |
355 | 'maxlength' => 255, |
356 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 357 | 'where' => 'civicrm_menu.return_url_args', |
522a26c9 | 358 | 'table_name' => 'civicrm_menu', |
359 | 'entity' => 'Menu', | |
360 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 361 | 'localizable' => 0, |
c3fc2621 CW |
362 | ], |
363 | 'component_id' => [ | |
e501603b TO |
364 | 'name' => 'component_id', |
365 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 366 | 'title' => ts('Component'), |
215b423e | 367 | 'description' => ts('Component that this menu item belongs to'), |
a36434b9 | 368 | 'where' => 'civicrm_menu.component_id', |
522a26c9 | 369 | 'table_name' => 'civicrm_menu', |
370 | 'entity' => 'Menu', | |
371 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 372 | 'localizable' => 0, |
e501603b | 373 | 'FKClassName' => 'CRM_Core_DAO_Component', |
c3fc2621 | 374 | 'html' => [ |
e501603b | 375 | 'type' => 'Select', |
c3fc2621 CW |
376 | ], |
377 | 'pseudoconstant' => [ | |
e501603b TO |
378 | 'table' => 'civicrm_component', |
379 | 'keyColumn' => 'id', | |
380 | 'labelColumn' => 'name', | |
e6ca0a57 | 381 | ], |
c3fc2621 CW |
382 | ], |
383 | 'is_active' => [ | |
e501603b TO |
384 | 'name' => 'is_active', |
385 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 386 | 'title' => ts('Enabled?'), |
215b423e | 387 | 'description' => ts('Is this menu item active?'), |
a36434b9 | 388 | 'where' => 'civicrm_menu.is_active', |
522a26c9 | 389 | 'table_name' => 'civicrm_menu', |
390 | 'entity' => 'Menu', | |
391 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 392 | 'localizable' => 0, |
c3fc2621 CW |
393 | ], |
394 | 'is_public' => [ | |
e501603b TO |
395 | 'name' => 'is_public', |
396 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 397 | 'title' => ts('Public?'), |
215b423e | 398 | 'description' => ts('Is this menu accessible to the public?'), |
a36434b9 | 399 | 'where' => 'civicrm_menu.is_public', |
522a26c9 | 400 | 'table_name' => 'civicrm_menu', |
401 | 'entity' => 'Menu', | |
402 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 403 | 'localizable' => 0, |
c3fc2621 CW |
404 | ], |
405 | 'is_exposed' => [ | |
e501603b TO |
406 | 'name' => 'is_exposed', |
407 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 408 | 'title' => ts('Exposed?'), |
215b423e | 409 | 'description' => ts('Is this menu exposed to the navigation system?'), |
a36434b9 | 410 | 'where' => 'civicrm_menu.is_exposed', |
522a26c9 | 411 | 'table_name' => 'civicrm_menu', |
412 | 'entity' => 'Menu', | |
413 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 414 | 'localizable' => 0, |
c3fc2621 CW |
415 | ], |
416 | 'is_ssl' => [ | |
e501603b TO |
417 | 'name' => 'is_ssl', |
418 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 419 | 'title' => ts('Use SSL?'), |
215b423e | 420 | 'description' => ts('Should this menu be exposed via SSL if enabled?'), |
a36434b9 | 421 | 'where' => 'civicrm_menu.is_ssl', |
522a26c9 | 422 | 'table_name' => 'civicrm_menu', |
423 | 'entity' => 'Menu', | |
424 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 425 | 'localizable' => 0, |
c3fc2621 CW |
426 | ], |
427 | 'weight' => [ | |
e501603b TO |
428 | 'name' => 'weight', |
429 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 430 | 'title' => ts('Order'), |
215b423e | 431 | 'description' => ts('Ordering of the menu items in various blocks.'), |
c3fc2621 | 432 | 'required' => TRUE, |
a36434b9 | 433 | 'where' => 'civicrm_menu.weight', |
e501603b | 434 | 'default' => '1', |
522a26c9 | 435 | 'table_name' => 'civicrm_menu', |
436 | 'entity' => 'Menu', | |
437 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 438 | 'localizable' => 0, |
c3fc2621 CW |
439 | ], |
440 | 'type' => [ | |
e501603b TO |
441 | 'name' => 'type', |
442 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 443 | 'title' => ts('Type'), |
215b423e | 444 | 'description' => ts('Drupal menu type.'), |
c3fc2621 | 445 | 'required' => TRUE, |
a36434b9 | 446 | 'where' => 'civicrm_menu.type', |
e501603b | 447 | 'default' => '1', |
522a26c9 | 448 | 'table_name' => 'civicrm_menu', |
449 | 'entity' => 'Menu', | |
450 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 451 | 'localizable' => 0, |
c3fc2621 CW |
452 | ], |
453 | 'page_type' => [ | |
e501603b TO |
454 | 'name' => 'page_type', |
455 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 456 | 'title' => ts('Page Type'), |
215b423e | 457 | 'description' => ts('CiviCRM menu type.'), |
c3fc2621 | 458 | 'required' => TRUE, |
a36434b9 | 459 | 'where' => 'civicrm_menu.page_type', |
e501603b | 460 | 'default' => '1', |
522a26c9 | 461 | 'table_name' => 'civicrm_menu', |
462 | 'entity' => 'Menu', | |
463 | 'bao' => 'CRM_Core_DAO_Menu', | |
6a7e5e5d | 464 | 'localizable' => 0, |
c3fc2621 CW |
465 | ], |
466 | 'skipBreadcrumb' => [ | |
e501603b TO |
467 | 'name' => 'skipBreadcrumb', |
468 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 469 | 'title' => ts('Hide Breadcrumb?'), |
215b423e | 470 | 'description' => ts('skip this url being exposed to breadcrumb'), |
a36434b9 | 471 | 'where' => 'civicrm_menu.skipBreadcrumb', |
522a26c9 | 472 | 'table_name' => 'civicrm_menu', |
473 | 'entity' => 'Menu', | |
b44dc91e TO |
474 | 'bao' => 'CRM_Core_DAO_Menu', |
475 | 'localizable' => 0, | |
c3fc2621 CW |
476 | ], |
477 | 'module_data' => [ | |
b44dc91e TO |
478 | 'name' => 'module_data', |
479 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 480 | 'title' => ts('Other menu data'), |
215b423e | 481 | 'description' => ts('All other menu metadata not stored in other fields'), |
a36434b9 | 482 | 'where' => 'civicrm_menu.module_data', |
b44dc91e TO |
483 | 'table_name' => 'civicrm_menu', |
484 | 'entity' => 'Menu', | |
522a26c9 | 485 | 'bao' => 'CRM_Core_DAO_Menu', |
6a7e5e5d | 486 | 'localizable' => 0, |
c3fc2621 CW |
487 | ], |
488 | ]; | |
346aaaba | 489 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 490 | } |
346aaaba | 491 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 492 | } |
c3fc2621 | 493 | |
e501603b | 494 | /** |
bd8e0b14 | 495 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
496 | * |
497 | * @return array | |
bd8e0b14 | 498 | * Array(string $name => string $uniqueName). |
e501603b | 499 | */ |
c3fc2621 | 500 | public static function &fieldKeys() { |
bd8e0b14 TO |
501 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
502 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 503 | } |
bd8e0b14 | 504 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 505 | } |
c3fc2621 | 506 | |
e501603b TO |
507 | /** |
508 | * Returns the names of this table | |
509 | * | |
510 | * @return string | |
511 | */ | |
c3fc2621 | 512 | public static function getTableName() { |
e501603b TO |
513 | return self::$_tableName; |
514 | } | |
c3fc2621 | 515 | |
e501603b TO |
516 | /** |
517 | * Returns if this table needs to be logged | |
518 | * | |
c3fc2621 | 519 | * @return bool |
e501603b | 520 | */ |
c3fc2621 | 521 | public function getLog() { |
e501603b TO |
522 | return self::$_log; |
523 | } | |
c3fc2621 | 524 | |
e501603b TO |
525 | /** |
526 | * Returns the list of fields that can be imported | |
527 | * | |
528 | * @param bool $prefix | |
529 | * | |
530 | * @return array | |
531 | */ | |
c3fc2621 CW |
532 | public static function &import($prefix = FALSE) { |
533 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'menu', $prefix, []); | |
60808919 | 534 | return $r; |
e501603b | 535 | } |
c3fc2621 | 536 | |
e501603b TO |
537 | /** |
538 | * Returns the list of fields that can be exported | |
539 | * | |
540 | * @param bool $prefix | |
541 | * | |
542 | * @return array | |
543 | */ | |
c3fc2621 CW |
544 | public static function &export($prefix = FALSE) { |
545 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'menu', $prefix, []); | |
60808919 | 546 | return $r; |
e501603b | 547 | } |
c3fc2621 | 548 | |
e7a6b91a AS |
549 | /** |
550 | * Returns the list of indices | |
c3fc2621 CW |
551 | * |
552 | * @param bool $localize | |
553 | * | |
554 | * @return array | |
e7a6b91a AS |
555 | */ |
556 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
557 | $indices = [ |
558 | 'UI_path_domain_id' => [ | |
e7a6b91a | 559 | 'name' => 'UI_path_domain_id', |
c3fc2621 | 560 | 'field' => [ |
e7a6b91a AS |
561 | 0 => 'path', |
562 | 1 => 'domain_id', | |
c3fc2621 CW |
563 | ], |
564 | 'localizable' => FALSE, | |
565 | 'unique' => TRUE, | |
e7a6b91a | 566 | 'sig' => 'civicrm_menu::1::path::domain_id', |
c3fc2621 CW |
567 | ], |
568 | ]; | |
e7a6b91a AS |
569 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
570 | } | |
c3fc2621 | 571 | |
e501603b | 572 | } |