5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Menu.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:190bae10088eb0999743b73f39fc92ca)
13 * Database access object for the Menu entity.
15 class CRM_Core_DAO_Menu
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_menu';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
41 * Which Domain is this menu item for
44 * (SQL type: int unsigned)
45 * Note that values will be retrieved from the database as a string.
53 * (SQL type: varchar(255))
54 * Note that values will be retrieved from the database as a string.
59 * Arguments to pass to the url
63 * Note that values will be retrieved from the database as a string.
65 public $path_arguments;
69 * (SQL type: varchar(255))
70 * Note that values will be retrieved from the database as a string.
75 * Function to call to check access permissions
78 * (SQL type: varchar(255))
79 * Note that values will be retrieved from the database as a string.
81 public $access_callback;
84 * Arguments to pass to access callback
88 * Note that values will be retrieved from the database as a string.
90 public $access_arguments;
93 * function to call for this url
96 * (SQL type: varchar(255))
97 * Note that values will be retrieved from the database as a string.
99 public $page_callback;
102 * Arguments to pass to page callback
106 * Note that values will be retrieved from the database as a string.
108 public $page_arguments;
111 * Breadcrumb for the path.
115 * Note that values will be retrieved from the database as a string.
120 * Url where a page should redirected to, if next url not known.
123 * (SQL type: varchar(255))
124 * Note that values will be retrieved from the database as a string.
129 * Arguments to pass to return_url
132 * (SQL type: varchar(255))
133 * Note that values will be retrieved from the database as a string.
135 public $return_url_args;
138 * Component that this menu item belongs to
140 * @var int|string|null
141 * (SQL type: int unsigned)
142 * Note that values will be retrieved from the database as a string.
144 public $component_id;
147 * Is this menu item active?
150 * (SQL type: tinyint)
151 * Note that values will be retrieved from the database as a string.
156 * Is this menu accessible to the public?
159 * (SQL type: tinyint)
160 * Note that values will be retrieved from the database as a string.
165 * Is this menu exposed to the navigation system?
168 * (SQL type: tinyint)
169 * Note that values will be retrieved from the database as a string.
174 * Should this menu be exposed via SSL if enabled?
177 * (SQL type: tinyint)
178 * Note that values will be retrieved from the database as a string.
183 * Ordering of the menu items in various blocks.
187 * Note that values will be retrieved from the database as a string.
196 * Note that values will be retrieved from the database as a string.
205 * Note that values will be retrieved from the database as a string.
210 * skip this url being exposed to breadcrumb
213 * (SQL type: tinyint)
214 * Note that values will be retrieved from the database as a string.
216 public $skipBreadcrumb;
219 * All other menu metadata not stored in other fields
223 * Note that values will be retrieved from the database as a string.
230 public function __construct() {
231 $this->__table
= 'civicrm_menu';
232 parent
::__construct();
236 * Returns localized title of this entity.
238 * @param bool $plural
239 * Whether to return the plural version of the title.
241 public static function getEntityTitle($plural = FALSE) {
242 return $plural ?
ts('Menus') : ts('Menu');
246 * Returns foreign keys and entity references.
249 * [CRM_Core_Reference_Interface]
251 public static function getReferenceColumns() {
252 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
253 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
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');
256 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
258 return Civi
::$statics[__CLASS__
]['links'];
262 * Returns all the column names of this table
266 public static function &fields() {
267 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
268 Civi
::$statics[__CLASS__
]['fields'] = [
271 'type' => CRM_Utils_Type
::T_INT
,
272 'title' => ts('Menu ID'),
274 'where' => 'civicrm_menu.id',
275 'table_name' => 'civicrm_menu',
277 'bao' => 'CRM_Core_DAO_Menu',
286 'name' => 'domain_id',
287 'type' => CRM_Utils_Type
::T_INT
,
288 'title' => ts('Domain ID'),
289 'description' => ts('Which Domain is this menu item for'),
291 'where' => 'civicrm_menu.domain_id',
292 'table_name' => 'civicrm_menu',
294 'bao' => 'CRM_Core_DAO_Menu',
296 'FKClassName' => 'CRM_Core_DAO_Domain',
298 'label' => ts("Domain"),
300 'pseudoconstant' => [
301 'table' => 'civicrm_domain',
303 'labelColumn' => 'name',
309 'type' => CRM_Utils_Type
::T_STRING
,
310 'title' => ts('Path'),
311 'description' => ts('Path Name'),
313 'size' => CRM_Utils_Type
::HUGE
,
314 'where' => 'civicrm_menu.path',
315 'table_name' => 'civicrm_menu',
317 'bao' => 'CRM_Core_DAO_Menu',
321 'path_arguments' => [
322 'name' => 'path_arguments',
323 'type' => CRM_Utils_Type
::T_TEXT
,
324 'title' => ts('Arguments'),
325 'description' => ts('Arguments to pass to the url'),
326 'where' => 'civicrm_menu.path_arguments',
327 'table_name' => 'civicrm_menu',
329 'bao' => 'CRM_Core_DAO_Menu',
335 'type' => CRM_Utils_Type
::T_STRING
,
336 'title' => ts('Menu Title'),
338 'size' => CRM_Utils_Type
::HUGE
,
339 'where' => 'civicrm_menu.title',
340 'table_name' => 'civicrm_menu',
342 'bao' => 'CRM_Core_DAO_Menu',
346 'access_callback' => [
347 'name' => 'access_callback',
348 'type' => CRM_Utils_Type
::T_STRING
,
349 'title' => ts('Access Callback'),
350 'description' => ts('Function to call to check access permissions'),
352 'size' => CRM_Utils_Type
::HUGE
,
353 'where' => 'civicrm_menu.access_callback',
354 'table_name' => 'civicrm_menu',
356 'bao' => 'CRM_Core_DAO_Menu',
360 'access_arguments' => [
361 'name' => 'access_arguments',
362 'type' => CRM_Utils_Type
::T_TEXT
,
363 'title' => ts('Access Arguments'),
364 'description' => ts('Arguments to pass to access callback'),
365 'where' => 'civicrm_menu.access_arguments',
366 'table_name' => 'civicrm_menu',
368 'bao' => 'CRM_Core_DAO_Menu',
373 'name' => 'page_callback',
374 'type' => CRM_Utils_Type
::T_STRING
,
375 'title' => ts('Page Callback'),
376 'description' => ts('function to call for this url'),
378 'size' => CRM_Utils_Type
::HUGE
,
379 'where' => 'civicrm_menu.page_callback',
380 'table_name' => 'civicrm_menu',
382 'bao' => 'CRM_Core_DAO_Menu',
386 'page_arguments' => [
387 'name' => 'page_arguments',
388 'type' => CRM_Utils_Type
::T_TEXT
,
389 'title' => ts('Page Arguments'),
390 'description' => ts('Arguments to pass to page callback'),
391 'where' => 'civicrm_menu.page_arguments',
392 'table_name' => 'civicrm_menu',
394 'bao' => 'CRM_Core_DAO_Menu',
399 'name' => 'breadcrumb',
400 'type' => CRM_Utils_Type
::T_TEXT
,
401 'title' => ts('Breadcrumb'),
402 'description' => ts('Breadcrumb for the path.'),
403 'where' => 'civicrm_menu.breadcrumb',
404 'table_name' => 'civicrm_menu',
406 'bao' => 'CRM_Core_DAO_Menu',
411 'name' => 'return_url',
412 'type' => CRM_Utils_Type
::T_STRING
,
413 'title' => ts('Return Url'),
414 'description' => ts('Url where a page should redirected to, if next url not known.'),
416 'size' => CRM_Utils_Type
::HUGE
,
417 'where' => 'civicrm_menu.return_url',
418 'table_name' => 'civicrm_menu',
420 'bao' => 'CRM_Core_DAO_Menu',
423 'label' => ts("Return URL"),
427 'return_url_args' => [
428 'name' => 'return_url_args',
429 'type' => CRM_Utils_Type
::T_STRING
,
430 'title' => ts('Return Url Args'),
431 'description' => ts('Arguments to pass to return_url'),
433 'size' => CRM_Utils_Type
::HUGE
,
434 'where' => 'civicrm_menu.return_url_args',
435 'table_name' => 'civicrm_menu',
437 'bao' => 'CRM_Core_DAO_Menu',
440 'label' => ts("Return URL Arguments"),
445 'name' => 'component_id',
446 'type' => CRM_Utils_Type
::T_INT
,
447 'title' => ts('Component ID'),
448 'description' => ts('Component that this menu item belongs to'),
449 'where' => 'civicrm_menu.component_id',
450 'table_name' => 'civicrm_menu',
452 'bao' => 'CRM_Core_DAO_Menu',
454 'FKClassName' => 'CRM_Core_DAO_Component',
457 'label' => ts("Component"),
459 'pseudoconstant' => [
460 'table' => 'civicrm_component',
462 'labelColumn' => 'name',
467 'name' => 'is_active',
468 'type' => CRM_Utils_Type
::T_BOOLEAN
,
469 'title' => ts('Enabled?'),
470 'description' => ts('Is this menu item active?'),
472 'where' => 'civicrm_menu.is_active',
474 'table_name' => 'civicrm_menu',
476 'bao' => 'CRM_Core_DAO_Menu',
481 'name' => 'is_public',
482 'type' => CRM_Utils_Type
::T_BOOLEAN
,
483 'title' => ts('Public?'),
484 'description' => ts('Is this menu accessible to the public?'),
486 'where' => 'civicrm_menu.is_public',
488 'table_name' => 'civicrm_menu',
490 'bao' => 'CRM_Core_DAO_Menu',
495 'name' => 'is_exposed',
496 'type' => CRM_Utils_Type
::T_BOOLEAN
,
497 'title' => ts('Exposed?'),
498 'description' => ts('Is this menu exposed to the navigation system?'),
500 'where' => 'civicrm_menu.is_exposed',
502 'table_name' => 'civicrm_menu',
504 'bao' => 'CRM_Core_DAO_Menu',
510 'type' => CRM_Utils_Type
::T_BOOLEAN
,
511 'title' => ts('Use SSL?'),
512 'description' => ts('Should this menu be exposed via SSL if enabled?'),
514 'where' => 'civicrm_menu.is_ssl',
516 'table_name' => 'civicrm_menu',
518 'bao' => 'CRM_Core_DAO_Menu',
524 'type' => CRM_Utils_Type
::T_INT
,
525 'title' => ts('Order'),
526 'description' => ts('Ordering of the menu items in various blocks.'),
528 'where' => 'civicrm_menu.weight',
530 'table_name' => 'civicrm_menu',
532 'bao' => 'CRM_Core_DAO_Menu',
538 'type' => CRM_Utils_Type
::T_INT
,
539 'title' => ts('Type'),
540 'description' => ts('Drupal menu type.'),
542 'where' => 'civicrm_menu.type',
544 'table_name' => 'civicrm_menu',
546 'bao' => 'CRM_Core_DAO_Menu',
551 'name' => 'page_type',
552 'type' => CRM_Utils_Type
::T_INT
,
553 'title' => ts('Page Type'),
554 'description' => ts('CiviCRM menu type.'),
556 'where' => 'civicrm_menu.page_type',
558 'table_name' => 'civicrm_menu',
560 'bao' => 'CRM_Core_DAO_Menu',
564 'skipBreadcrumb' => [
565 'name' => 'skipBreadcrumb',
566 'type' => CRM_Utils_Type
::T_BOOLEAN
,
567 'title' => ts('Hide Breadcrumb?'),
568 'description' => ts('skip this url being exposed to breadcrumb'),
570 'where' => 'civicrm_menu.skipBreadcrumb',
572 'table_name' => 'civicrm_menu',
574 'bao' => 'CRM_Core_DAO_Menu',
579 'name' => 'module_data',
580 'type' => CRM_Utils_Type
::T_TEXT
,
581 'title' => ts('Other menu data'),
582 'description' => ts('All other menu metadata not stored in other fields'),
583 'where' => 'civicrm_menu.module_data',
584 'table_name' => 'civicrm_menu',
586 'bao' => 'CRM_Core_DAO_Menu',
591 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
593 return Civi
::$statics[__CLASS__
]['fields'];
597 * Return a mapping from field-name to the corresponding key (as used in fields()).
600 * Array(string $name => string $uniqueName).
602 public static function &fieldKeys() {
603 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
604 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
606 return Civi
::$statics[__CLASS__
]['fieldKeys'];
610 * Returns the names of this table
614 public static function getTableName() {
615 return self
::$_tableName;
619 * Returns if this table needs to be logged
623 public function getLog() {
628 * Returns the list of fields that can be imported
630 * @param bool $prefix
634 public static function &import($prefix = FALSE) {
635 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'menu', $prefix, []);
640 * Returns the list of fields that can be exported
642 * @param bool $prefix
646 public static function &export($prefix = FALSE) {
647 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'menu', $prefix, []);
652 * Returns the list of indices
654 * @param bool $localize
658 public static function indices($localize = TRUE) {
660 'UI_path_domain_id' => [
661 'name' => 'UI_path_domain_id',
666 'localizable' => FALSE,
668 'sig' => 'civicrm_menu::1::path::domain_id',
671 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;