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:43fa7e0ff85619af0065d2802de6f8f4)
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;
39 * Which Domain is this menu item for
53 * Arguments to pass to the url
57 public $path_arguments;
65 * Function to call to check access permissions
69 public $access_callback;
72 * Arguments to pass to access callback
76 public $access_arguments;
79 * function to call for this url
83 public $page_callback;
86 * Arguments to pass to page callback
90 public $page_arguments;
93 * Breadcrumb for the path.
100 * Url where a page should redirected to, if next url not known.
107 * Arguments to pass to return_url
111 public $return_url_args;
114 * Component that this menu item belongs to
118 public $component_id;
121 * Is this menu item active?
128 * Is this menu accessible to the public?
135 * Is this menu exposed to the navigation system?
142 * Should this menu be exposed via SSL if enabled?
149 * Ordering of the menu items in various blocks.
170 * skip this url being exposed to breadcrumb
174 public $skipBreadcrumb;
177 * All other menu metadata not stored in other fields
186 public function __construct() {
187 $this->__table
= 'civicrm_menu';
188 parent
::__construct();
192 * Returns localized title of this entity.
194 * @param bool $plural
195 * Whether to return the plural version of the title.
197 public static function getEntityTitle($plural = FALSE) {
198 return $plural ?
ts('Menus') : ts('Menu');
202 * Returns foreign keys and entity references.
205 * [CRM_Core_Reference_Interface]
207 public static function getReferenceColumns() {
208 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
209 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
210 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
211 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'component_id', 'civicrm_component', 'id');
212 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
214 return Civi
::$statics[__CLASS__
]['links'];
218 * Returns all the column names of this table
222 public static function &fields() {
223 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
224 Civi
::$statics[__CLASS__
]['fields'] = [
227 'type' => CRM_Utils_Type
::T_INT
,
228 'title' => ts('Menu ID'),
230 'where' => 'civicrm_menu.id',
231 'table_name' => 'civicrm_menu',
233 'bao' => 'CRM_Core_DAO_Menu',
242 'name' => 'domain_id',
243 'type' => CRM_Utils_Type
::T_INT
,
244 'title' => ts('Domain ID'),
245 'description' => ts('Which Domain is this menu item for'),
247 'where' => 'civicrm_menu.domain_id',
248 'table_name' => 'civicrm_menu',
250 'bao' => 'CRM_Core_DAO_Menu',
252 'FKClassName' => 'CRM_Core_DAO_Domain',
254 'label' => ts("Domain"),
256 'pseudoconstant' => [
257 'table' => 'civicrm_domain',
259 'labelColumn' => 'name',
265 'type' => CRM_Utils_Type
::T_STRING
,
266 'title' => ts('Path'),
267 'description' => ts('Path Name'),
269 'size' => CRM_Utils_Type
::HUGE
,
270 'where' => 'civicrm_menu.path',
271 'table_name' => 'civicrm_menu',
273 'bao' => 'CRM_Core_DAO_Menu',
277 'path_arguments' => [
278 'name' => 'path_arguments',
279 'type' => CRM_Utils_Type
::T_TEXT
,
280 'title' => ts('Arguments'),
281 'description' => ts('Arguments to pass to the url'),
282 'where' => 'civicrm_menu.path_arguments',
283 'table_name' => 'civicrm_menu',
285 'bao' => 'CRM_Core_DAO_Menu',
291 'type' => CRM_Utils_Type
::T_STRING
,
292 'title' => ts('Menu Title'),
294 'size' => CRM_Utils_Type
::HUGE
,
295 'where' => 'civicrm_menu.title',
296 'table_name' => 'civicrm_menu',
298 'bao' => 'CRM_Core_DAO_Menu',
302 'access_callback' => [
303 'name' => 'access_callback',
304 'type' => CRM_Utils_Type
::T_STRING
,
305 'title' => ts('Access Callback'),
306 'description' => ts('Function to call to check access permissions'),
308 'size' => CRM_Utils_Type
::HUGE
,
309 'where' => 'civicrm_menu.access_callback',
310 'table_name' => 'civicrm_menu',
312 'bao' => 'CRM_Core_DAO_Menu',
316 'access_arguments' => [
317 'name' => 'access_arguments',
318 'type' => CRM_Utils_Type
::T_TEXT
,
319 'title' => ts('Access Arguments'),
320 'description' => ts('Arguments to pass to access callback'),
321 'where' => 'civicrm_menu.access_arguments',
322 'table_name' => 'civicrm_menu',
324 'bao' => 'CRM_Core_DAO_Menu',
329 'name' => 'page_callback',
330 'type' => CRM_Utils_Type
::T_STRING
,
331 'title' => ts('Page Callback'),
332 'description' => ts('function to call for this url'),
334 'size' => CRM_Utils_Type
::HUGE
,
335 'where' => 'civicrm_menu.page_callback',
336 'table_name' => 'civicrm_menu',
338 'bao' => 'CRM_Core_DAO_Menu',
342 'page_arguments' => [
343 'name' => 'page_arguments',
344 'type' => CRM_Utils_Type
::T_TEXT
,
345 'title' => ts('Page Arguments'),
346 'description' => ts('Arguments to pass to page callback'),
347 'where' => 'civicrm_menu.page_arguments',
348 'table_name' => 'civicrm_menu',
350 'bao' => 'CRM_Core_DAO_Menu',
355 'name' => 'breadcrumb',
356 'type' => CRM_Utils_Type
::T_TEXT
,
357 'title' => ts('Breadcrumb'),
358 'description' => ts('Breadcrumb for the path.'),
359 'where' => 'civicrm_menu.breadcrumb',
360 'table_name' => 'civicrm_menu',
362 'bao' => 'CRM_Core_DAO_Menu',
367 'name' => 'return_url',
368 'type' => CRM_Utils_Type
::T_STRING
,
369 'title' => ts('Return Url'),
370 'description' => ts('Url where a page should redirected to, if next url not known.'),
372 'size' => CRM_Utils_Type
::HUGE
,
373 'where' => 'civicrm_menu.return_url',
374 'table_name' => 'civicrm_menu',
376 'bao' => 'CRM_Core_DAO_Menu',
379 'label' => ts("Return URL"),
383 'return_url_args' => [
384 'name' => 'return_url_args',
385 'type' => CRM_Utils_Type
::T_STRING
,
386 'title' => ts('Return Url Args'),
387 'description' => ts('Arguments to pass to return_url'),
389 'size' => CRM_Utils_Type
::HUGE
,
390 'where' => 'civicrm_menu.return_url_args',
391 'table_name' => 'civicrm_menu',
393 'bao' => 'CRM_Core_DAO_Menu',
396 'label' => ts("Return URL Arguments"),
401 'name' => 'component_id',
402 'type' => CRM_Utils_Type
::T_INT
,
403 'title' => ts('Component ID'),
404 'description' => ts('Component that this menu item belongs to'),
405 'where' => 'civicrm_menu.component_id',
406 'table_name' => 'civicrm_menu',
408 'bao' => 'CRM_Core_DAO_Menu',
410 'FKClassName' => 'CRM_Core_DAO_Component',
413 'label' => ts("Component"),
415 'pseudoconstant' => [
416 'table' => 'civicrm_component',
418 'labelColumn' => 'name',
423 'name' => 'is_active',
424 'type' => CRM_Utils_Type
::T_BOOLEAN
,
425 'title' => ts('Enabled?'),
426 'description' => ts('Is this menu item active?'),
427 'where' => 'civicrm_menu.is_active',
428 'table_name' => 'civicrm_menu',
430 'bao' => 'CRM_Core_DAO_Menu',
435 'name' => 'is_public',
436 'type' => CRM_Utils_Type
::T_BOOLEAN
,
437 'title' => ts('Public?'),
438 'description' => ts('Is this menu accessible to the public?'),
439 'where' => 'civicrm_menu.is_public',
440 'table_name' => 'civicrm_menu',
442 'bao' => 'CRM_Core_DAO_Menu',
447 'name' => 'is_exposed',
448 'type' => CRM_Utils_Type
::T_BOOLEAN
,
449 'title' => ts('Exposed?'),
450 'description' => ts('Is this menu exposed to the navigation system?'),
451 'where' => 'civicrm_menu.is_exposed',
452 'table_name' => 'civicrm_menu',
454 'bao' => 'CRM_Core_DAO_Menu',
460 'type' => CRM_Utils_Type
::T_BOOLEAN
,
461 'title' => ts('Use SSL?'),
462 'description' => ts('Should this menu be exposed via SSL if enabled?'),
463 'where' => 'civicrm_menu.is_ssl',
464 'table_name' => 'civicrm_menu',
466 'bao' => 'CRM_Core_DAO_Menu',
472 'type' => CRM_Utils_Type
::T_INT
,
473 'title' => ts('Order'),
474 'description' => ts('Ordering of the menu items in various blocks.'),
476 'where' => 'civicrm_menu.weight',
478 'table_name' => 'civicrm_menu',
480 'bao' => 'CRM_Core_DAO_Menu',
486 'type' => CRM_Utils_Type
::T_INT
,
487 'title' => ts('Type'),
488 'description' => ts('Drupal menu type.'),
490 'where' => 'civicrm_menu.type',
492 'table_name' => 'civicrm_menu',
494 'bao' => 'CRM_Core_DAO_Menu',
499 'name' => 'page_type',
500 'type' => CRM_Utils_Type
::T_INT
,
501 'title' => ts('Page Type'),
502 'description' => ts('CiviCRM menu type.'),
504 'where' => 'civicrm_menu.page_type',
506 'table_name' => 'civicrm_menu',
508 'bao' => 'CRM_Core_DAO_Menu',
512 'skipBreadcrumb' => [
513 'name' => 'skipBreadcrumb',
514 'type' => CRM_Utils_Type
::T_BOOLEAN
,
515 'title' => ts('Hide Breadcrumb?'),
516 'description' => ts('skip this url being exposed to breadcrumb'),
517 'where' => 'civicrm_menu.skipBreadcrumb',
518 'table_name' => 'civicrm_menu',
520 'bao' => 'CRM_Core_DAO_Menu',
525 'name' => 'module_data',
526 'type' => CRM_Utils_Type
::T_TEXT
,
527 'title' => ts('Other menu data'),
528 'description' => ts('All other menu metadata not stored in other fields'),
529 'where' => 'civicrm_menu.module_data',
530 'table_name' => 'civicrm_menu',
532 'bao' => 'CRM_Core_DAO_Menu',
537 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
539 return Civi
::$statics[__CLASS__
]['fields'];
543 * Return a mapping from field-name to the corresponding key (as used in fields()).
546 * Array(string $name => string $uniqueName).
548 public static function &fieldKeys() {
549 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
550 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
552 return Civi
::$statics[__CLASS__
]['fieldKeys'];
556 * Returns the names of this table
560 public static function getTableName() {
561 return self
::$_tableName;
565 * Returns if this table needs to be logged
569 public function getLog() {
574 * Returns the list of fields that can be imported
576 * @param bool $prefix
580 public static function &import($prefix = FALSE) {
581 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'menu', $prefix, []);
586 * Returns the list of fields that can be exported
588 * @param bool $prefix
592 public static function &export($prefix = FALSE) {
593 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'menu', $prefix, []);
598 * Returns the list of indices
600 * @param bool $localize
604 public static function indices($localize = TRUE) {
606 'UI_path_domain_id' => [
607 'name' => 'UI_path_domain_id',
612 'localizable' => FALSE,
614 'sig' => 'civicrm_menu::1::path::domain_id',
617 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;