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:a6c1c555579640a8bb83b496ee126e1a)
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?
149 * @var bool|string|null
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?
158 * @var bool|string|null
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?
167 * @var bool|string|null
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?
176 * @var bool|string|null
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
212 * @var bool|string|null
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?'),
471 'where' => 'civicrm_menu.is_active',
472 'table_name' => 'civicrm_menu',
474 'bao' => 'CRM_Core_DAO_Menu',
479 'name' => 'is_public',
480 'type' => CRM_Utils_Type
::T_BOOLEAN
,
481 'title' => ts('Public?'),
482 'description' => ts('Is this menu accessible to the public?'),
483 'where' => 'civicrm_menu.is_public',
484 'table_name' => 'civicrm_menu',
486 'bao' => 'CRM_Core_DAO_Menu',
491 'name' => 'is_exposed',
492 'type' => CRM_Utils_Type
::T_BOOLEAN
,
493 'title' => ts('Exposed?'),
494 'description' => ts('Is this menu exposed to the navigation system?'),
495 'where' => 'civicrm_menu.is_exposed',
496 'table_name' => 'civicrm_menu',
498 'bao' => 'CRM_Core_DAO_Menu',
504 'type' => CRM_Utils_Type
::T_BOOLEAN
,
505 'title' => ts('Use SSL?'),
506 'description' => ts('Should this menu be exposed via SSL if enabled?'),
507 'where' => 'civicrm_menu.is_ssl',
508 'table_name' => 'civicrm_menu',
510 'bao' => 'CRM_Core_DAO_Menu',
516 'type' => CRM_Utils_Type
::T_INT
,
517 'title' => ts('Order'),
518 'description' => ts('Ordering of the menu items in various blocks.'),
520 'where' => 'civicrm_menu.weight',
522 'table_name' => 'civicrm_menu',
524 'bao' => 'CRM_Core_DAO_Menu',
530 'type' => CRM_Utils_Type
::T_INT
,
531 'title' => ts('Type'),
532 'description' => ts('Drupal menu type.'),
534 'where' => 'civicrm_menu.type',
536 'table_name' => 'civicrm_menu',
538 'bao' => 'CRM_Core_DAO_Menu',
543 'name' => 'page_type',
544 'type' => CRM_Utils_Type
::T_INT
,
545 'title' => ts('Page Type'),
546 'description' => ts('CiviCRM menu type.'),
548 'where' => 'civicrm_menu.page_type',
550 'table_name' => 'civicrm_menu',
552 'bao' => 'CRM_Core_DAO_Menu',
556 'skipBreadcrumb' => [
557 'name' => 'skipBreadcrumb',
558 'type' => CRM_Utils_Type
::T_BOOLEAN
,
559 'title' => ts('Hide Breadcrumb?'),
560 'description' => ts('skip this url being exposed to breadcrumb'),
561 'where' => 'civicrm_menu.skipBreadcrumb',
562 'table_name' => 'civicrm_menu',
564 'bao' => 'CRM_Core_DAO_Menu',
569 'name' => 'module_data',
570 'type' => CRM_Utils_Type
::T_TEXT
,
571 'title' => ts('Other menu data'),
572 'description' => ts('All other menu metadata not stored in other fields'),
573 'where' => 'civicrm_menu.module_data',
574 'table_name' => 'civicrm_menu',
576 'bao' => 'CRM_Core_DAO_Menu',
581 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
583 return Civi
::$statics[__CLASS__
]['fields'];
587 * Return a mapping from field-name to the corresponding key (as used in fields()).
590 * Array(string $name => string $uniqueName).
592 public static function &fieldKeys() {
593 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
594 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
596 return Civi
::$statics[__CLASS__
]['fieldKeys'];
600 * Returns the names of this table
604 public static function getTableName() {
605 return self
::$_tableName;
609 * Returns if this table needs to be logged
613 public function getLog() {
618 * Returns the list of fields that can be imported
620 * @param bool $prefix
624 public static function &import($prefix = FALSE) {
625 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'menu', $prefix, []);
630 * Returns the list of fields that can be exported
632 * @param bool $prefix
636 public static function &export($prefix = FALSE) {
637 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'menu', $prefix, []);
642 * Returns the list of indices
644 * @param bool $localize
648 public static function indices($localize = TRUE) {
650 'UI_path_domain_id' => [
651 'name' => 'UI_path_domain_id',
656 'localizable' => FALSE,
658 'sig' => 'civicrm_menu::1::path::domain_id',
661 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;