Merge pull request #23192 from eileenmcnaughton/549
[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
d5d0525a 9 * (GenCodeChecksum:190bae10088eb0999743b73f39fc92ca)
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 *
c1e814c7 149 * @var bool|string
28979d65
CW
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 *
c1e814c7 158 * @var bool|string
28979d65
CW
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 *
c1e814c7 167 * @var bool|string
28979d65
CW
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 *
c1e814c7 176 * @var bool|string
28979d65
CW
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 *
c1e814c7 212 * @var bool|string
28979d65
CW
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?'),
c1e814c7 471 'required' => TRUE,
a36434b9 472 'where' => 'civicrm_menu.is_active',
c1e814c7 473 'default' => '1',
522a26c9 474 'table_name' => 'civicrm_menu',
475 'entity' => 'Menu',
476 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 477 'localizable' => 0,
a9d0587b 478 'add' => '2.1',
c3fc2621
CW
479 ],
480 'is_public' => [
e501603b
TO
481 'name' => 'is_public',
482 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 483 'title' => ts('Public?'),
215b423e 484 'description' => ts('Is this menu accessible to the public?'),
c1e814c7 485 'required' => TRUE,
a36434b9 486 'where' => 'civicrm_menu.is_public',
d5d0525a 487 'default' => '0',
522a26c9 488 'table_name' => 'civicrm_menu',
489 'entity' => 'Menu',
490 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 491 'localizable' => 0,
a9d0587b 492 'add' => '2.1',
c3fc2621
CW
493 ],
494 'is_exposed' => [
e501603b
TO
495 'name' => 'is_exposed',
496 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 497 'title' => ts('Exposed?'),
215b423e 498 'description' => ts('Is this menu exposed to the navigation system?'),
c1e814c7 499 'required' => TRUE,
a36434b9 500 'where' => 'civicrm_menu.is_exposed',
c1e814c7 501 'default' => '1',
522a26c9 502 'table_name' => 'civicrm_menu',
503 'entity' => 'Menu',
504 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 505 'localizable' => 0,
a9d0587b 506 'add' => '2.1',
c3fc2621
CW
507 ],
508 'is_ssl' => [
e501603b
TO
509 'name' => 'is_ssl',
510 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 511 'title' => ts('Use SSL?'),
215b423e 512 'description' => ts('Should this menu be exposed via SSL if enabled?'),
c1e814c7 513 'required' => TRUE,
a36434b9 514 'where' => 'civicrm_menu.is_ssl',
c1e814c7 515 'default' => '1',
522a26c9 516 'table_name' => 'civicrm_menu',
517 'entity' => 'Menu',
518 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 519 'localizable' => 0,
a9d0587b 520 'add' => '2.1',
c3fc2621
CW
521 ],
522 'weight' => [
e501603b
TO
523 'name' => 'weight',
524 'type' => CRM_Utils_Type::T_INT,
c3fc2621 525 'title' => ts('Order'),
215b423e 526 'description' => ts('Ordering of the menu items in various blocks.'),
c3fc2621 527 'required' => TRUE,
a36434b9 528 'where' => 'civicrm_menu.weight',
e501603b 529 'default' => '1',
522a26c9 530 'table_name' => 'civicrm_menu',
531 'entity' => 'Menu',
532 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 533 'localizable' => 0,
a9d0587b 534 'add' => '2.1',
c3fc2621
CW
535 ],
536 'type' => [
e501603b
TO
537 'name' => 'type',
538 'type' => CRM_Utils_Type::T_INT,
c3fc2621 539 'title' => ts('Type'),
215b423e 540 'description' => ts('Drupal menu type.'),
c3fc2621 541 'required' => TRUE,
a36434b9 542 'where' => 'civicrm_menu.type',
e501603b 543 'default' => '1',
522a26c9 544 'table_name' => 'civicrm_menu',
545 'entity' => 'Menu',
546 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 547 'localizable' => 0,
a9d0587b 548 'add' => '2.1',
c3fc2621
CW
549 ],
550 'page_type' => [
e501603b
TO
551 'name' => 'page_type',
552 'type' => CRM_Utils_Type::T_INT,
c3fc2621 553 'title' => ts('Page Type'),
215b423e 554 'description' => ts('CiviCRM menu type.'),
c3fc2621 555 'required' => TRUE,
a36434b9 556 'where' => 'civicrm_menu.page_type',
e501603b 557 'default' => '1',
522a26c9 558 'table_name' => 'civicrm_menu',
559 'entity' => 'Menu',
560 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 561 'localizable' => 0,
a9d0587b 562 'add' => '2.1',
c3fc2621
CW
563 ],
564 'skipBreadcrumb' => [
e501603b
TO
565 'name' => 'skipBreadcrumb',
566 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 567 'title' => ts('Hide Breadcrumb?'),
215b423e 568 'description' => ts('skip this url being exposed to breadcrumb'),
c1e814c7 569 'required' => TRUE,
a36434b9 570 'where' => 'civicrm_menu.skipBreadcrumb',
c1e814c7 571 'default' => '0',
522a26c9 572 'table_name' => 'civicrm_menu',
573 'entity' => 'Menu',
b44dc91e
TO
574 'bao' => 'CRM_Core_DAO_Menu',
575 'localizable' => 0,
a9d0587b 576 'add' => '2.2',
c3fc2621
CW
577 ],
578 'module_data' => [
b44dc91e
TO
579 'name' => 'module_data',
580 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 581 'title' => ts('Other menu data'),
215b423e 582 'description' => ts('All other menu metadata not stored in other fields'),
a36434b9 583 'where' => 'civicrm_menu.module_data',
b44dc91e
TO
584 'table_name' => 'civicrm_menu',
585 'entity' => 'Menu',
522a26c9 586 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 587 'localizable' => 0,
a9d0587b 588 'add' => '4.7',
c3fc2621
CW
589 ],
590 ];
346aaaba 591 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 592 }
346aaaba 593 return Civi::$statics[__CLASS__]['fields'];
e501603b 594 }
c3fc2621 595
e501603b 596 /**
bd8e0b14 597 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
598 *
599 * @return array
bd8e0b14 600 * Array(string $name => string $uniqueName).
e501603b 601 */
c3fc2621 602 public static function &fieldKeys() {
bd8e0b14
TO
603 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
604 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 605 }
bd8e0b14 606 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 607 }
c3fc2621 608
e501603b
TO
609 /**
610 * Returns the names of this table
611 *
612 * @return string
613 */
c3fc2621 614 public static function getTableName() {
e501603b
TO
615 return self::$_tableName;
616 }
c3fc2621 617
e501603b
TO
618 /**
619 * Returns if this table needs to be logged
620 *
c3fc2621 621 * @return bool
e501603b 622 */
c3fc2621 623 public function getLog() {
e501603b
TO
624 return self::$_log;
625 }
c3fc2621 626
e501603b
TO
627 /**
628 * Returns the list of fields that can be imported
629 *
630 * @param bool $prefix
631 *
632 * @return array
633 */
c3fc2621
CW
634 public static function &import($prefix = FALSE) {
635 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'menu', $prefix, []);
60808919 636 return $r;
e501603b 637 }
c3fc2621 638
e501603b
TO
639 /**
640 * Returns the list of fields that can be exported
641 *
642 * @param bool $prefix
643 *
644 * @return array
645 */
c3fc2621
CW
646 public static function &export($prefix = FALSE) {
647 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'menu', $prefix, []);
60808919 648 return $r;
e501603b 649 }
c3fc2621 650
e7a6b91a
AS
651 /**
652 * Returns the list of indices
c3fc2621
CW
653 *
654 * @param bool $localize
655 *
656 * @return array
e7a6b91a
AS
657 */
658 public static function indices($localize = TRUE) {
c3fc2621
CW
659 $indices = [
660 'UI_path_domain_id' => [
e7a6b91a 661 'name' => 'UI_path_domain_id',
c3fc2621 662 'field' => [
e7a6b91a
AS
663 0 => 'path',
664 1 => 'domain_id',
c3fc2621
CW
665 ],
666 'localizable' => FALSE,
667 'unique' => TRUE,
e7a6b91a 668 'sig' => 'civicrm_menu::1::path::domain_id',
c3fc2621
CW
669 ],
670 ];
e7a6b91a
AS
671 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
672 }
c3fc2621 673
e501603b 674}