5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/Menu.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:42fee92ca199cddbfabfac15b1f3d641)
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 foreign keys and entity references.
193 * [CRM_Core_Reference_Interface]
195 public static function getReferenceColumns() {
196 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
197 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
198 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
199 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'component_id', 'civicrm_component', 'id');
200 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
202 return Civi
::$statics[__CLASS__
]['links'];
206 * Returns all the column names of this table
210 public static function &fields() {
211 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
212 Civi
::$statics[__CLASS__
]['fields'] = [
215 'type' => CRM_Utils_Type
::T_INT
,
216 'title' => ts('Menu ID'),
218 'where' => 'civicrm_menu.id',
219 'table_name' => 'civicrm_menu',
221 'bao' => 'CRM_Core_DAO_Menu',
225 'name' => 'domain_id',
226 'type' => CRM_Utils_Type
::T_INT
,
227 'title' => ts('Domain'),
228 'description' => ts('Which Domain is this menu item for'),
230 'where' => 'civicrm_menu.domain_id',
231 'table_name' => 'civicrm_menu',
233 'bao' => 'CRM_Core_DAO_Menu',
235 'FKClassName' => 'CRM_Core_DAO_Domain',
236 'pseudoconstant' => [
237 'table' => 'civicrm_domain',
239 'labelColumn' => 'name',
244 'type' => CRM_Utils_Type
::T_STRING
,
245 'title' => ts('Path'),
246 'description' => ts('Path Name'),
248 'size' => CRM_Utils_Type
::HUGE
,
249 'where' => 'civicrm_menu.path',
250 'table_name' => 'civicrm_menu',
252 'bao' => 'CRM_Core_DAO_Menu',
255 'path_arguments' => [
256 'name' => 'path_arguments',
257 'type' => CRM_Utils_Type
::T_TEXT
,
258 'title' => ts('Arguments'),
259 'description' => ts('Arguments to pass to the url'),
260 'where' => 'civicrm_menu.path_arguments',
261 'table_name' => 'civicrm_menu',
263 'bao' => 'CRM_Core_DAO_Menu',
268 'type' => CRM_Utils_Type
::T_STRING
,
269 'title' => ts('Menu Title'),
271 'size' => CRM_Utils_Type
::HUGE
,
272 'where' => 'civicrm_menu.title',
273 'table_name' => 'civicrm_menu',
275 'bao' => 'CRM_Core_DAO_Menu',
278 'access_callback' => [
279 'name' => 'access_callback',
280 'type' => CRM_Utils_Type
::T_STRING
,
281 'title' => ts('Access Callback'),
282 'description' => ts('Function to call to check access permissions'),
284 'size' => CRM_Utils_Type
::HUGE
,
285 'where' => 'civicrm_menu.access_callback',
286 'table_name' => 'civicrm_menu',
288 'bao' => 'CRM_Core_DAO_Menu',
291 'access_arguments' => [
292 'name' => 'access_arguments',
293 'type' => CRM_Utils_Type
::T_TEXT
,
294 'title' => ts('Access Arguments'),
295 'description' => ts('Arguments to pass to access callback'),
296 'where' => 'civicrm_menu.access_arguments',
297 'table_name' => 'civicrm_menu',
299 'bao' => 'CRM_Core_DAO_Menu',
303 'name' => 'page_callback',
304 'type' => CRM_Utils_Type
::T_STRING
,
305 'title' => ts('Page Callback'),
306 'description' => ts('function to call for this url'),
308 'size' => CRM_Utils_Type
::HUGE
,
309 'where' => 'civicrm_menu.page_callback',
310 'table_name' => 'civicrm_menu',
312 'bao' => 'CRM_Core_DAO_Menu',
315 'page_arguments' => [
316 'name' => 'page_arguments',
317 'type' => CRM_Utils_Type
::T_TEXT
,
318 'title' => ts('Page Arguments'),
319 'description' => ts('Arguments to pass to page callback'),
320 'where' => 'civicrm_menu.page_arguments',
321 'table_name' => 'civicrm_menu',
323 'bao' => 'CRM_Core_DAO_Menu',
327 'name' => 'breadcrumb',
328 'type' => CRM_Utils_Type
::T_TEXT
,
329 'title' => ts('Breadcrumb'),
330 'description' => ts('Breadcrumb for the path.'),
331 'where' => 'civicrm_menu.breadcrumb',
332 'table_name' => 'civicrm_menu',
334 'bao' => 'CRM_Core_DAO_Menu',
338 'name' => 'return_url',
339 'type' => CRM_Utils_Type
::T_STRING
,
340 'title' => ts('Return Url'),
341 'description' => ts('Url where a page should redirected to, if next url not known.'),
343 'size' => CRM_Utils_Type
::HUGE
,
344 'where' => 'civicrm_menu.return_url',
345 'table_name' => 'civicrm_menu',
347 'bao' => 'CRM_Core_DAO_Menu',
350 'return_url_args' => [
351 'name' => 'return_url_args',
352 'type' => CRM_Utils_Type
::T_STRING
,
353 'title' => ts('Return Url Args'),
354 'description' => ts('Arguments to pass to return_url'),
356 'size' => CRM_Utils_Type
::HUGE
,
357 'where' => 'civicrm_menu.return_url_args',
358 'table_name' => 'civicrm_menu',
360 'bao' => 'CRM_Core_DAO_Menu',
364 'name' => 'component_id',
365 'type' => CRM_Utils_Type
::T_INT
,
366 'title' => ts('Component'),
367 'description' => ts('Component that this menu item belongs to'),
368 'where' => 'civicrm_menu.component_id',
369 'table_name' => 'civicrm_menu',
371 'bao' => 'CRM_Core_DAO_Menu',
373 'FKClassName' => 'CRM_Core_DAO_Component',
377 'pseudoconstant' => [
378 'table' => 'civicrm_component',
380 'labelColumn' => 'name',
384 'name' => 'is_active',
385 'type' => CRM_Utils_Type
::T_BOOLEAN
,
386 'title' => ts('Enabled?'),
387 'description' => ts('Is this menu item active?'),
388 'where' => 'civicrm_menu.is_active',
389 'table_name' => 'civicrm_menu',
391 'bao' => 'CRM_Core_DAO_Menu',
395 'name' => 'is_public',
396 'type' => CRM_Utils_Type
::T_BOOLEAN
,
397 'title' => ts('Public?'),
398 'description' => ts('Is this menu accessible to the public?'),
399 'where' => 'civicrm_menu.is_public',
400 'table_name' => 'civicrm_menu',
402 'bao' => 'CRM_Core_DAO_Menu',
406 'name' => 'is_exposed',
407 'type' => CRM_Utils_Type
::T_BOOLEAN
,
408 'title' => ts('Exposed?'),
409 'description' => ts('Is this menu exposed to the navigation system?'),
410 'where' => 'civicrm_menu.is_exposed',
411 'table_name' => 'civicrm_menu',
413 'bao' => 'CRM_Core_DAO_Menu',
418 'type' => CRM_Utils_Type
::T_BOOLEAN
,
419 'title' => ts('Use SSL?'),
420 'description' => ts('Should this menu be exposed via SSL if enabled?'),
421 'where' => 'civicrm_menu.is_ssl',
422 'table_name' => 'civicrm_menu',
424 'bao' => 'CRM_Core_DAO_Menu',
429 'type' => CRM_Utils_Type
::T_INT
,
430 'title' => ts('Order'),
431 'description' => ts('Ordering of the menu items in various blocks.'),
433 'where' => 'civicrm_menu.weight',
435 'table_name' => 'civicrm_menu',
437 'bao' => 'CRM_Core_DAO_Menu',
442 'type' => CRM_Utils_Type
::T_INT
,
443 'title' => ts('Type'),
444 'description' => ts('Drupal menu type.'),
446 'where' => 'civicrm_menu.type',
448 'table_name' => 'civicrm_menu',
450 'bao' => 'CRM_Core_DAO_Menu',
454 'name' => 'page_type',
455 'type' => CRM_Utils_Type
::T_INT
,
456 'title' => ts('Page Type'),
457 'description' => ts('CiviCRM menu type.'),
459 'where' => 'civicrm_menu.page_type',
461 'table_name' => 'civicrm_menu',
463 'bao' => 'CRM_Core_DAO_Menu',
466 'skipBreadcrumb' => [
467 'name' => 'skipBreadcrumb',
468 'type' => CRM_Utils_Type
::T_BOOLEAN
,
469 'title' => ts('Hide Breadcrumb?'),
470 'description' => ts('skip this url being exposed to breadcrumb'),
471 'where' => 'civicrm_menu.skipBreadcrumb',
472 'table_name' => 'civicrm_menu',
474 'bao' => 'CRM_Core_DAO_Menu',
478 'name' => 'module_data',
479 'type' => CRM_Utils_Type
::T_TEXT
,
480 'title' => ts('Other menu data'),
481 'description' => ts('All other menu metadata not stored in other fields'),
482 'where' => 'civicrm_menu.module_data',
483 'table_name' => 'civicrm_menu',
485 'bao' => 'CRM_Core_DAO_Menu',
489 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
491 return Civi
::$statics[__CLASS__
]['fields'];
495 * Return a mapping from field-name to the corresponding key (as used in fields()).
498 * Array(string $name => string $uniqueName).
500 public static function &fieldKeys() {
501 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
502 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
504 return Civi
::$statics[__CLASS__
]['fieldKeys'];
508 * Returns the names of this table
512 public static function getTableName() {
513 return self
::$_tableName;
517 * Returns if this table needs to be logged
521 public function getLog() {
526 * Returns the list of fields that can be imported
528 * @param bool $prefix
532 public static function &import($prefix = FALSE) {
533 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'menu', $prefix, []);
538 * Returns the list of fields that can be exported
540 * @param bool $prefix
544 public static function &export($prefix = FALSE) {
545 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'menu', $prefix, []);
550 * Returns the list of indices
552 * @param bool $localize
556 public static function indices($localize = TRUE) {
558 'UI_path_domain_id' => [
559 'name' => 'UI_path_domain_id',
564 'localizable' => FALSE,
566 'sig' => 'civicrm_menu::1::path::domain_id',
569 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;