5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Core/Menu.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:78591d8ca17fb4eb39a7123f35399035)
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 static $_tableName = 'civicrm_menu';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_menu',
220 'bao' => 'CRM_Core_DAO_Menu',
224 'name' => 'domain_id',
225 'type' => CRM_Utils_Type
::T_INT
,
226 'title' => ts('Domain'),
227 'description' => 'Which Domain is this menu item for',
229 'table_name' => 'civicrm_menu',
231 'bao' => 'CRM_Core_DAO_Menu',
233 'FKClassName' => 'CRM_Core_DAO_Domain',
234 'pseudoconstant' => [
235 'table' => 'civicrm_domain',
237 'labelColumn' => 'name',
242 'type' => CRM_Utils_Type
::T_STRING
,
243 'title' => ts('Path'),
244 'description' => 'Path Name',
246 'size' => CRM_Utils_Type
::HUGE
,
247 'table_name' => 'civicrm_menu',
249 'bao' => 'CRM_Core_DAO_Menu',
252 'path_arguments' => [
253 'name' => 'path_arguments',
254 'type' => CRM_Utils_Type
::T_TEXT
,
255 'title' => ts('Arguments'),
256 'description' => 'Arguments to pass to the url',
257 'table_name' => 'civicrm_menu',
259 'bao' => 'CRM_Core_DAO_Menu',
264 'type' => CRM_Utils_Type
::T_STRING
,
265 'title' => ts('Menu Title'),
267 'size' => CRM_Utils_Type
::HUGE
,
268 'table_name' => 'civicrm_menu',
270 'bao' => 'CRM_Core_DAO_Menu',
273 'access_callback' => [
274 'name' => 'access_callback',
275 'type' => CRM_Utils_Type
::T_STRING
,
276 'title' => ts('Access Callback'),
277 'description' => 'Function to call to check access permissions',
279 'size' => CRM_Utils_Type
::HUGE
,
280 'table_name' => 'civicrm_menu',
282 'bao' => 'CRM_Core_DAO_Menu',
285 'access_arguments' => [
286 'name' => 'access_arguments',
287 'type' => CRM_Utils_Type
::T_TEXT
,
288 'title' => ts('Access Arguments'),
289 'description' => 'Arguments to pass to access callback',
290 'table_name' => 'civicrm_menu',
292 'bao' => 'CRM_Core_DAO_Menu',
296 'name' => 'page_callback',
297 'type' => CRM_Utils_Type
::T_STRING
,
298 'title' => ts('Page Callback'),
299 'description' => 'function to call for this url',
301 'size' => CRM_Utils_Type
::HUGE
,
302 'table_name' => 'civicrm_menu',
304 'bao' => 'CRM_Core_DAO_Menu',
307 'page_arguments' => [
308 'name' => 'page_arguments',
309 'type' => CRM_Utils_Type
::T_TEXT
,
310 'title' => ts('Page Arguments'),
311 'description' => 'Arguments to pass to page callback',
312 'table_name' => 'civicrm_menu',
314 'bao' => 'CRM_Core_DAO_Menu',
318 'name' => 'breadcrumb',
319 'type' => CRM_Utils_Type
::T_TEXT
,
320 'title' => ts('Breadcrumb'),
321 'description' => 'Breadcrumb for the path.',
322 'table_name' => 'civicrm_menu',
324 'bao' => 'CRM_Core_DAO_Menu',
328 'name' => 'return_url',
329 'type' => CRM_Utils_Type
::T_STRING
,
330 'title' => ts('Return Url'),
331 'description' => 'Url where a page should redirected to, if next url not known.',
333 'size' => CRM_Utils_Type
::HUGE
,
334 'table_name' => 'civicrm_menu',
336 'bao' => 'CRM_Core_DAO_Menu',
339 'return_url_args' => [
340 'name' => 'return_url_args',
341 'type' => CRM_Utils_Type
::T_STRING
,
342 'title' => ts('Return Url Args'),
343 'description' => 'Arguments to pass to return_url',
345 'size' => CRM_Utils_Type
::HUGE
,
346 'table_name' => 'civicrm_menu',
348 'bao' => 'CRM_Core_DAO_Menu',
352 'name' => 'component_id',
353 'type' => CRM_Utils_Type
::T_INT
,
354 'title' => ts('Component'),
355 'description' => 'Component that this menu item belongs to',
356 'table_name' => 'civicrm_menu',
358 'bao' => 'CRM_Core_DAO_Menu',
360 'FKClassName' => 'CRM_Core_DAO_Component',
364 'pseudoconstant' => [
365 'table' => 'civicrm_component',
367 'labelColumn' => 'name',
371 'name' => 'is_active',
372 'type' => CRM_Utils_Type
::T_BOOLEAN
,
373 'title' => ts('Enabled?'),
374 'description' => 'Is this menu item active?',
375 'table_name' => 'civicrm_menu',
377 'bao' => 'CRM_Core_DAO_Menu',
381 'name' => 'is_public',
382 'type' => CRM_Utils_Type
::T_BOOLEAN
,
383 'title' => ts('Public?'),
384 'description' => 'Is this menu accessible to the public?',
385 'table_name' => 'civicrm_menu',
387 'bao' => 'CRM_Core_DAO_Menu',
391 'name' => 'is_exposed',
392 'type' => CRM_Utils_Type
::T_BOOLEAN
,
393 'title' => ts('Exposed?'),
394 'description' => 'Is this menu exposed to the navigation system?',
395 'table_name' => 'civicrm_menu',
397 'bao' => 'CRM_Core_DAO_Menu',
402 'type' => CRM_Utils_Type
::T_BOOLEAN
,
403 'title' => ts('Use SSL?'),
404 'description' => 'Should this menu be exposed via SSL if enabled?',
405 'table_name' => 'civicrm_menu',
407 'bao' => 'CRM_Core_DAO_Menu',
412 'type' => CRM_Utils_Type
::T_INT
,
413 'title' => ts('Order'),
414 'description' => 'Ordering of the menu items in various blocks.',
417 'table_name' => 'civicrm_menu',
419 'bao' => 'CRM_Core_DAO_Menu',
424 'type' => CRM_Utils_Type
::T_INT
,
425 'title' => ts('Type'),
426 'description' => 'Drupal menu type.',
429 'table_name' => 'civicrm_menu',
431 'bao' => 'CRM_Core_DAO_Menu',
435 'name' => 'page_type',
436 'type' => CRM_Utils_Type
::T_INT
,
437 'title' => ts('Page Type'),
438 'description' => 'CiviCRM menu type.',
441 'table_name' => 'civicrm_menu',
443 'bao' => 'CRM_Core_DAO_Menu',
446 'skipBreadcrumb' => [
447 'name' => 'skipBreadcrumb',
448 'type' => CRM_Utils_Type
::T_BOOLEAN
,
449 'title' => ts('Hide Breadcrumb?'),
450 'description' => 'skip this url being exposed to breadcrumb',
451 'table_name' => 'civicrm_menu',
453 'bao' => 'CRM_Core_DAO_Menu',
457 'name' => 'module_data',
458 'type' => CRM_Utils_Type
::T_TEXT
,
459 'title' => ts('Other menu data'),
460 'description' => 'All other menu metadata not stored in other fields',
461 'table_name' => 'civicrm_menu',
463 'bao' => 'CRM_Core_DAO_Menu',
467 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
469 return Civi
::$statics[__CLASS__
]['fields'];
473 * Return a mapping from field-name to the corresponding key (as used in fields()).
476 * Array(string $name => string $uniqueName).
478 public static function &fieldKeys() {
479 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
480 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
482 return Civi
::$statics[__CLASS__
]['fieldKeys'];
486 * Returns the names of this table
490 public static function getTableName() {
491 return self
::$_tableName;
495 * Returns if this table needs to be logged
499 public function getLog() {
504 * Returns the list of fields that can be imported
506 * @param bool $prefix
510 public static function &import($prefix = FALSE) {
511 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'menu', $prefix, []);
516 * Returns the list of fields that can be exported
518 * @param bool $prefix
522 public static function &export($prefix = FALSE) {
523 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'menu', $prefix, []);
528 * Returns the list of indices
530 * @param bool $localize
534 public static function indices($localize = TRUE) {
536 'UI_path_domain_id' => [
537 'name' => 'UI_path_domain_id',
542 'localizable' => FALSE,
544 'sig' => 'civicrm_menu::1::path::domain_id',
547 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;