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:b94ecc10dafe21deb7e5067ef46f32af)
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',
238 'name' => 'domain_id',
239 'type' => CRM_Utils_Type
::T_INT
,
240 'title' => ts('Domain'),
241 'description' => ts('Which Domain is this menu item for'),
243 'where' => 'civicrm_menu.domain_id',
244 'table_name' => 'civicrm_menu',
246 'bao' => 'CRM_Core_DAO_Menu',
248 'FKClassName' => 'CRM_Core_DAO_Domain',
249 'pseudoconstant' => [
250 'table' => 'civicrm_domain',
252 'labelColumn' => 'name',
258 'type' => CRM_Utils_Type
::T_STRING
,
259 'title' => ts('Path'),
260 'description' => ts('Path Name'),
262 'size' => CRM_Utils_Type
::HUGE
,
263 'where' => 'civicrm_menu.path',
264 'table_name' => 'civicrm_menu',
266 'bao' => 'CRM_Core_DAO_Menu',
270 'path_arguments' => [
271 'name' => 'path_arguments',
272 'type' => CRM_Utils_Type
::T_TEXT
,
273 'title' => ts('Arguments'),
274 'description' => ts('Arguments to pass to the url'),
275 'where' => 'civicrm_menu.path_arguments',
276 'table_name' => 'civicrm_menu',
278 'bao' => 'CRM_Core_DAO_Menu',
284 'type' => CRM_Utils_Type
::T_STRING
,
285 'title' => ts('Menu Title'),
287 'size' => CRM_Utils_Type
::HUGE
,
288 'where' => 'civicrm_menu.title',
289 'table_name' => 'civicrm_menu',
291 'bao' => 'CRM_Core_DAO_Menu',
295 'access_callback' => [
296 'name' => 'access_callback',
297 'type' => CRM_Utils_Type
::T_STRING
,
298 'title' => ts('Access Callback'),
299 'description' => ts('Function to call to check access permissions'),
301 'size' => CRM_Utils_Type
::HUGE
,
302 'where' => 'civicrm_menu.access_callback',
303 'table_name' => 'civicrm_menu',
305 'bao' => 'CRM_Core_DAO_Menu',
309 'access_arguments' => [
310 'name' => 'access_arguments',
311 'type' => CRM_Utils_Type
::T_TEXT
,
312 'title' => ts('Access Arguments'),
313 'description' => ts('Arguments to pass to access callback'),
314 'where' => 'civicrm_menu.access_arguments',
315 'table_name' => 'civicrm_menu',
317 'bao' => 'CRM_Core_DAO_Menu',
322 'name' => 'page_callback',
323 'type' => CRM_Utils_Type
::T_STRING
,
324 'title' => ts('Page Callback'),
325 'description' => ts('function to call for this url'),
327 'size' => CRM_Utils_Type
::HUGE
,
328 'where' => 'civicrm_menu.page_callback',
329 'table_name' => 'civicrm_menu',
331 'bao' => 'CRM_Core_DAO_Menu',
335 'page_arguments' => [
336 'name' => 'page_arguments',
337 'type' => CRM_Utils_Type
::T_TEXT
,
338 'title' => ts('Page Arguments'),
339 'description' => ts('Arguments to pass to page callback'),
340 'where' => 'civicrm_menu.page_arguments',
341 'table_name' => 'civicrm_menu',
343 'bao' => 'CRM_Core_DAO_Menu',
348 'name' => 'breadcrumb',
349 'type' => CRM_Utils_Type
::T_TEXT
,
350 'title' => ts('Breadcrumb'),
351 'description' => ts('Breadcrumb for the path.'),
352 'where' => 'civicrm_menu.breadcrumb',
353 'table_name' => 'civicrm_menu',
355 'bao' => 'CRM_Core_DAO_Menu',
360 'name' => 'return_url',
361 'type' => CRM_Utils_Type
::T_STRING
,
362 'title' => ts('Return Url'),
363 'description' => ts('Url where a page should redirected to, if next url not known.'),
365 'size' => CRM_Utils_Type
::HUGE
,
366 'where' => 'civicrm_menu.return_url',
367 'table_name' => 'civicrm_menu',
369 'bao' => 'CRM_Core_DAO_Menu',
373 'return_url_args' => [
374 'name' => 'return_url_args',
375 'type' => CRM_Utils_Type
::T_STRING
,
376 'title' => ts('Return Url Args'),
377 'description' => ts('Arguments to pass to return_url'),
379 'size' => CRM_Utils_Type
::HUGE
,
380 'where' => 'civicrm_menu.return_url_args',
381 'table_name' => 'civicrm_menu',
383 'bao' => 'CRM_Core_DAO_Menu',
388 'name' => 'component_id',
389 'type' => CRM_Utils_Type
::T_INT
,
390 'title' => ts('Component'),
391 'description' => ts('Component that this menu item belongs to'),
392 'where' => 'civicrm_menu.component_id',
393 'table_name' => 'civicrm_menu',
395 'bao' => 'CRM_Core_DAO_Menu',
397 'FKClassName' => 'CRM_Core_DAO_Component',
401 'pseudoconstant' => [
402 'table' => 'civicrm_component',
404 'labelColumn' => 'name',
409 'name' => 'is_active',
410 'type' => CRM_Utils_Type
::T_BOOLEAN
,
411 'title' => ts('Enabled?'),
412 'description' => ts('Is this menu item active?'),
413 'where' => 'civicrm_menu.is_active',
414 'table_name' => 'civicrm_menu',
416 'bao' => 'CRM_Core_DAO_Menu',
421 'name' => 'is_public',
422 'type' => CRM_Utils_Type
::T_BOOLEAN
,
423 'title' => ts('Public?'),
424 'description' => ts('Is this menu accessible to the public?'),
425 'where' => 'civicrm_menu.is_public',
426 'table_name' => 'civicrm_menu',
428 'bao' => 'CRM_Core_DAO_Menu',
433 'name' => 'is_exposed',
434 'type' => CRM_Utils_Type
::T_BOOLEAN
,
435 'title' => ts('Exposed?'),
436 'description' => ts('Is this menu exposed to the navigation system?'),
437 'where' => 'civicrm_menu.is_exposed',
438 'table_name' => 'civicrm_menu',
440 'bao' => 'CRM_Core_DAO_Menu',
446 'type' => CRM_Utils_Type
::T_BOOLEAN
,
447 'title' => ts('Use SSL?'),
448 'description' => ts('Should this menu be exposed via SSL if enabled?'),
449 'where' => 'civicrm_menu.is_ssl',
450 'table_name' => 'civicrm_menu',
452 'bao' => 'CRM_Core_DAO_Menu',
458 'type' => CRM_Utils_Type
::T_INT
,
459 'title' => ts('Order'),
460 'description' => ts('Ordering of the menu items in various blocks.'),
462 'where' => 'civicrm_menu.weight',
464 'table_name' => 'civicrm_menu',
466 'bao' => 'CRM_Core_DAO_Menu',
472 'type' => CRM_Utils_Type
::T_INT
,
473 'title' => ts('Type'),
474 'description' => ts('Drupal menu type.'),
476 'where' => 'civicrm_menu.type',
478 'table_name' => 'civicrm_menu',
480 'bao' => 'CRM_Core_DAO_Menu',
485 'name' => 'page_type',
486 'type' => CRM_Utils_Type
::T_INT
,
487 'title' => ts('Page Type'),
488 'description' => ts('CiviCRM menu type.'),
490 'where' => 'civicrm_menu.page_type',
492 'table_name' => 'civicrm_menu',
494 'bao' => 'CRM_Core_DAO_Menu',
498 'skipBreadcrumb' => [
499 'name' => 'skipBreadcrumb',
500 'type' => CRM_Utils_Type
::T_BOOLEAN
,
501 'title' => ts('Hide Breadcrumb?'),
502 'description' => ts('skip this url being exposed to breadcrumb'),
503 'where' => 'civicrm_menu.skipBreadcrumb',
504 'table_name' => 'civicrm_menu',
506 'bao' => 'CRM_Core_DAO_Menu',
511 'name' => 'module_data',
512 'type' => CRM_Utils_Type
::T_TEXT
,
513 'title' => ts('Other menu data'),
514 'description' => ts('All other menu metadata not stored in other fields'),
515 'where' => 'civicrm_menu.module_data',
516 'table_name' => 'civicrm_menu',
518 'bao' => 'CRM_Core_DAO_Menu',
523 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
525 return Civi
::$statics[__CLASS__
]['fields'];
529 * Return a mapping from field-name to the corresponding key (as used in fields()).
532 * Array(string $name => string $uniqueName).
534 public static function &fieldKeys() {
535 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
536 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
538 return Civi
::$statics[__CLASS__
]['fieldKeys'];
542 * Returns the names of this table
546 public static function getTableName() {
547 return self
::$_tableName;
551 * Returns if this table needs to be logged
555 public function getLog() {
560 * Returns the list of fields that can be imported
562 * @param bool $prefix
566 public static function &import($prefix = FALSE) {
567 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'menu', $prefix, []);
572 * Returns the list of fields that can be exported
574 * @param bool $prefix
578 public static function &export($prefix = FALSE) {
579 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'menu', $prefix, []);
584 * Returns the list of indices
586 * @param bool $localize
590 public static function indices($localize = TRUE) {
592 'UI_path_domain_id' => [
593 'name' => 'UI_path_domain_id',
598 'localizable' => FALSE,
600 'sig' => 'civicrm_menu::1::path::domain_id',
603 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;