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:8eaee41a6e8192bd26fab7f4ef443c0c)
13 * Database access object for the Menu entity.
15 class CRM_Core_DAO_Menu
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_menu';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
37 * Which Domain is this menu item for
51 * Arguments to pass to the url
55 public $path_arguments;
63 * Function to call to check access permissions
67 public $access_callback;
70 * Arguments to pass to access callback
74 public $access_arguments;
77 * function to call for this url
81 public $page_callback;
84 * Arguments to pass to page callback
88 public $page_arguments;
91 * Breadcrumb for the path.
98 * Url where a page should redirected to, if next url not known.
105 * Arguments to pass to return_url
109 public $return_url_args;
112 * Component that this menu item belongs to
116 public $component_id;
119 * Is this menu item active?
126 * Is this menu accessible to the public?
133 * Is this menu exposed to the navigation system?
140 * Should this menu be exposed via SSL if enabled?
147 * Ordering of the menu items in various blocks.
168 * skip this url being exposed to breadcrumb
172 public $skipBreadcrumb;
175 * All other menu metadata not stored in other fields
184 public function __construct() {
185 $this->__table
= 'civicrm_menu';
186 parent
::__construct();
190 * Returns localized title of this entity.
192 public static function getEntityTitle() {
197 * Returns foreign keys and entity references.
200 * [CRM_Core_Reference_Interface]
202 public static function getReferenceColumns() {
203 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
204 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
205 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
206 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'component_id', 'civicrm_component', 'id');
207 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
209 return Civi
::$statics[__CLASS__
]['links'];
213 * Returns all the column names of this table
217 public static function &fields() {
218 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
219 Civi
::$statics[__CLASS__
]['fields'] = [
222 'type' => CRM_Utils_Type
::T_INT
,
223 'title' => ts('Menu ID'),
225 'where' => 'civicrm_menu.id',
226 'table_name' => 'civicrm_menu',
228 'bao' => 'CRM_Core_DAO_Menu',
233 'name' => 'domain_id',
234 'type' => CRM_Utils_Type
::T_INT
,
235 'title' => ts('Domain'),
236 'description' => ts('Which Domain is this menu item for'),
238 'where' => 'civicrm_menu.domain_id',
239 'table_name' => 'civicrm_menu',
241 'bao' => 'CRM_Core_DAO_Menu',
243 'FKClassName' => 'CRM_Core_DAO_Domain',
244 'pseudoconstant' => [
245 'table' => 'civicrm_domain',
247 'labelColumn' => 'name',
253 'type' => CRM_Utils_Type
::T_STRING
,
254 'title' => ts('Path'),
255 'description' => ts('Path Name'),
257 'size' => CRM_Utils_Type
::HUGE
,
258 'where' => 'civicrm_menu.path',
259 'table_name' => 'civicrm_menu',
261 'bao' => 'CRM_Core_DAO_Menu',
265 'path_arguments' => [
266 'name' => 'path_arguments',
267 'type' => CRM_Utils_Type
::T_TEXT
,
268 'title' => ts('Arguments'),
269 'description' => ts('Arguments to pass to the url'),
270 'where' => 'civicrm_menu.path_arguments',
271 'table_name' => 'civicrm_menu',
273 'bao' => 'CRM_Core_DAO_Menu',
279 'type' => CRM_Utils_Type
::T_STRING
,
280 'title' => ts('Menu Title'),
282 'size' => CRM_Utils_Type
::HUGE
,
283 'where' => 'civicrm_menu.title',
284 'table_name' => 'civicrm_menu',
286 'bao' => 'CRM_Core_DAO_Menu',
290 'access_callback' => [
291 'name' => 'access_callback',
292 'type' => CRM_Utils_Type
::T_STRING
,
293 'title' => ts('Access Callback'),
294 'description' => ts('Function to call to check access permissions'),
296 'size' => CRM_Utils_Type
::HUGE
,
297 'where' => 'civicrm_menu.access_callback',
298 'table_name' => 'civicrm_menu',
300 'bao' => 'CRM_Core_DAO_Menu',
304 'access_arguments' => [
305 'name' => 'access_arguments',
306 'type' => CRM_Utils_Type
::T_TEXT
,
307 'title' => ts('Access Arguments'),
308 'description' => ts('Arguments to pass to access callback'),
309 'where' => 'civicrm_menu.access_arguments',
310 'table_name' => 'civicrm_menu',
312 'bao' => 'CRM_Core_DAO_Menu',
317 'name' => 'page_callback',
318 'type' => CRM_Utils_Type
::T_STRING
,
319 'title' => ts('Page Callback'),
320 'description' => ts('function to call for this url'),
322 'size' => CRM_Utils_Type
::HUGE
,
323 'where' => 'civicrm_menu.page_callback',
324 'table_name' => 'civicrm_menu',
326 'bao' => 'CRM_Core_DAO_Menu',
330 'page_arguments' => [
331 'name' => 'page_arguments',
332 'type' => CRM_Utils_Type
::T_TEXT
,
333 'title' => ts('Page Arguments'),
334 'description' => ts('Arguments to pass to page callback'),
335 'where' => 'civicrm_menu.page_arguments',
336 'table_name' => 'civicrm_menu',
338 'bao' => 'CRM_Core_DAO_Menu',
343 'name' => 'breadcrumb',
344 'type' => CRM_Utils_Type
::T_TEXT
,
345 'title' => ts('Breadcrumb'),
346 'description' => ts('Breadcrumb for the path.'),
347 'where' => 'civicrm_menu.breadcrumb',
348 'table_name' => 'civicrm_menu',
350 'bao' => 'CRM_Core_DAO_Menu',
355 'name' => 'return_url',
356 'type' => CRM_Utils_Type
::T_STRING
,
357 'title' => ts('Return Url'),
358 'description' => ts('Url where a page should redirected to, if next url not known.'),
360 'size' => CRM_Utils_Type
::HUGE
,
361 'where' => 'civicrm_menu.return_url',
362 'table_name' => 'civicrm_menu',
364 'bao' => 'CRM_Core_DAO_Menu',
368 'return_url_args' => [
369 'name' => 'return_url_args',
370 'type' => CRM_Utils_Type
::T_STRING
,
371 'title' => ts('Return Url Args'),
372 'description' => ts('Arguments to pass to return_url'),
374 'size' => CRM_Utils_Type
::HUGE
,
375 'where' => 'civicrm_menu.return_url_args',
376 'table_name' => 'civicrm_menu',
378 'bao' => 'CRM_Core_DAO_Menu',
383 'name' => 'component_id',
384 'type' => CRM_Utils_Type
::T_INT
,
385 'title' => ts('Component'),
386 'description' => ts('Component that this menu item belongs to'),
387 'where' => 'civicrm_menu.component_id',
388 'table_name' => 'civicrm_menu',
390 'bao' => 'CRM_Core_DAO_Menu',
392 'FKClassName' => 'CRM_Core_DAO_Component',
396 'pseudoconstant' => [
397 'table' => 'civicrm_component',
399 'labelColumn' => 'name',
404 'name' => 'is_active',
405 'type' => CRM_Utils_Type
::T_BOOLEAN
,
406 'title' => ts('Enabled?'),
407 'description' => ts('Is this menu item active?'),
408 'where' => 'civicrm_menu.is_active',
409 'table_name' => 'civicrm_menu',
411 'bao' => 'CRM_Core_DAO_Menu',
416 'name' => 'is_public',
417 'type' => CRM_Utils_Type
::T_BOOLEAN
,
418 'title' => ts('Public?'),
419 'description' => ts('Is this menu accessible to the public?'),
420 'where' => 'civicrm_menu.is_public',
421 'table_name' => 'civicrm_menu',
423 'bao' => 'CRM_Core_DAO_Menu',
428 'name' => 'is_exposed',
429 'type' => CRM_Utils_Type
::T_BOOLEAN
,
430 'title' => ts('Exposed?'),
431 'description' => ts('Is this menu exposed to the navigation system?'),
432 'where' => 'civicrm_menu.is_exposed',
433 'table_name' => 'civicrm_menu',
435 'bao' => 'CRM_Core_DAO_Menu',
441 'type' => CRM_Utils_Type
::T_BOOLEAN
,
442 'title' => ts('Use SSL?'),
443 'description' => ts('Should this menu be exposed via SSL if enabled?'),
444 'where' => 'civicrm_menu.is_ssl',
445 'table_name' => 'civicrm_menu',
447 'bao' => 'CRM_Core_DAO_Menu',
453 'type' => CRM_Utils_Type
::T_INT
,
454 'title' => ts('Order'),
455 'description' => ts('Ordering of the menu items in various blocks.'),
457 'where' => 'civicrm_menu.weight',
459 'table_name' => 'civicrm_menu',
461 'bao' => 'CRM_Core_DAO_Menu',
467 'type' => CRM_Utils_Type
::T_INT
,
468 'title' => ts('Type'),
469 'description' => ts('Drupal menu type.'),
471 'where' => 'civicrm_menu.type',
473 'table_name' => 'civicrm_menu',
475 'bao' => 'CRM_Core_DAO_Menu',
480 'name' => 'page_type',
481 'type' => CRM_Utils_Type
::T_INT
,
482 'title' => ts('Page Type'),
483 'description' => ts('CiviCRM menu type.'),
485 'where' => 'civicrm_menu.page_type',
487 'table_name' => 'civicrm_menu',
489 'bao' => 'CRM_Core_DAO_Menu',
493 'skipBreadcrumb' => [
494 'name' => 'skipBreadcrumb',
495 'type' => CRM_Utils_Type
::T_BOOLEAN
,
496 'title' => ts('Hide Breadcrumb?'),
497 'description' => ts('skip this url being exposed to breadcrumb'),
498 'where' => 'civicrm_menu.skipBreadcrumb',
499 'table_name' => 'civicrm_menu',
501 'bao' => 'CRM_Core_DAO_Menu',
506 'name' => 'module_data',
507 'type' => CRM_Utils_Type
::T_TEXT
,
508 'title' => ts('Other menu data'),
509 'description' => ts('All other menu metadata not stored in other fields'),
510 'where' => 'civicrm_menu.module_data',
511 'table_name' => 'civicrm_menu',
513 'bao' => 'CRM_Core_DAO_Menu',
518 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
520 return Civi
::$statics[__CLASS__
]['fields'];
524 * Return a mapping from field-name to the corresponding key (as used in fields()).
527 * Array(string $name => string $uniqueName).
529 public static function &fieldKeys() {
530 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
531 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
533 return Civi
::$statics[__CLASS__
]['fieldKeys'];
537 * Returns the names of this table
541 public static function getTableName() {
542 return self
::$_tableName;
546 * Returns if this table needs to be logged
550 public function getLog() {
555 * Returns the list of fields that can be imported
557 * @param bool $prefix
561 public static function &import($prefix = FALSE) {
562 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'menu', $prefix, []);
567 * Returns the list of fields that can be exported
569 * @param bool $prefix
573 public static function &export($prefix = FALSE) {
574 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'menu', $prefix, []);
579 * Returns the list of indices
581 * @param bool $localize
585 public static function indices($localize = TRUE) {
587 'UI_path_domain_id' => [
588 'name' => 'UI_path_domain_id',
593 'localizable' => FALSE,
595 'sig' => 'civicrm_menu::1::path::domain_id',
598 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;