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