Define gettext translation for world_region
[civicrm-core.git] / CRM / Core / DAO / Menu.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
8c9251b3 5 * @copyright CiviCRM LLC (c) 2004-2018
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Core/Menu.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
e380ee3b 9 * (GenCodeChecksum:ea477a411301cae7e78667099c0f654c)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the Menu entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_Menu extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_menu';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
c3fc2621
CW
29 static $_log = FALSE;
30
e501603b 31 /**
e501603b
TO
32 * @var int unsigned
33 */
34 public $id;
c3fc2621 35
e501603b
TO
36 /**
37 * Which Domain is this menu item for
38 *
39 * @var int unsigned
40 */
41 public $domain_id;
c3fc2621 42
e501603b
TO
43 /**
44 * Path Name
45 *
46 * @var string
47 */
48 public $path;
c3fc2621 49
e501603b
TO
50 /**
51 * Arguments to pass to the url
52 *
53 * @var text
54 */
55 public $path_arguments;
c3fc2621 56
e501603b 57 /**
e501603b
TO
58 * @var string
59 */
60 public $title;
c3fc2621 61
e501603b
TO
62 /**
63 * Function to call to check access permissions
64 *
65 * @var string
66 */
67 public $access_callback;
c3fc2621 68
e501603b
TO
69 /**
70 * Arguments to pass to access callback
71 *
72 * @var text
73 */
74 public $access_arguments;
c3fc2621 75
e501603b
TO
76 /**
77 * function to call for this url
78 *
79 * @var string
80 */
81 public $page_callback;
c3fc2621 82
e501603b
TO
83 /**
84 * Arguments to pass to page callback
85 *
86 * @var text
87 */
88 public $page_arguments;
c3fc2621 89
e501603b
TO
90 /**
91 * Breadcrumb for the path.
92 *
93 * @var text
94 */
95 public $breadcrumb;
c3fc2621 96
e501603b
TO
97 /**
98 * Url where a page should redirected to, if next url not known.
99 *
100 * @var string
101 */
102 public $return_url;
c3fc2621 103
e501603b
TO
104 /**
105 * Arguments to pass to return_url
106 *
107 * @var string
108 */
109 public $return_url_args;
c3fc2621 110
e501603b
TO
111 /**
112 * Component that this menu item belongs to
113 *
114 * @var int unsigned
115 */
116 public $component_id;
c3fc2621 117
e501603b
TO
118 /**
119 * Is this menu item active?
120 *
121 * @var boolean
122 */
123 public $is_active;
c3fc2621 124
e501603b
TO
125 /**
126 * Is this menu accessible to the public?
127 *
128 * @var boolean
129 */
130 public $is_public;
c3fc2621 131
e501603b
TO
132 /**
133 * Is this menu exposed to the navigation system?
134 *
135 * @var boolean
136 */
137 public $is_exposed;
c3fc2621 138
e501603b
TO
139 /**
140 * Should this menu be exposed via SSL if enabled?
141 *
142 * @var boolean
143 */
144 public $is_ssl;
c3fc2621 145
e501603b
TO
146 /**
147 * Ordering of the menu items in various blocks.
148 *
149 * @var int
150 */
151 public $weight;
c3fc2621 152
e501603b
TO
153 /**
154 * Drupal menu type.
155 *
156 * @var int
157 */
158 public $type;
c3fc2621 159
e501603b
TO
160 /**
161 * CiviCRM menu type.
162 *
163 * @var int
164 */
165 public $page_type;
c3fc2621 166
e501603b
TO
167 /**
168 * skip this url being exposed to breadcrumb
169 *
170 * @var boolean
171 */
172 public $skipBreadcrumb;
c3fc2621 173
b44dc91e
TO
174 /**
175 * All other menu metadata not stored in other fields
176 *
177 * @var text
178 */
179 public $module_data;
c3fc2621 180
e501603b 181 /**
f41f0342 182 * Class constructor.
e501603b 183 */
c3fc2621 184 public function __construct() {
e501603b
TO
185 $this->__table = 'civicrm_menu';
186 parent::__construct();
187 }
c3fc2621 188
e501603b 189 /**
f41f0342 190 * Returns foreign keys and entity references.
e501603b
TO
191 *
192 * @return array
193 * [CRM_Core_Reference_Interface]
194 */
c3fc2621 195 public static function getReferenceColumns() {
346aaaba
TO
196 if (!isset(Civi::$statics[__CLASS__]['links'])) {
197 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
c3fc2621
CW
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');
346aaaba 200 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 201 }
346aaaba 202 return Civi::$statics[__CLASS__]['links'];
e501603b 203 }
c3fc2621 204
e501603b
TO
205 /**
206 * Returns all the column names of this table
207 *
208 * @return array
209 */
c3fc2621 210 public static function &fields() {
346aaaba 211 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
212 Civi::$statics[__CLASS__]['fields'] = [
213 'id' => [
e501603b
TO
214 'name' => 'id',
215 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
216 'title' => ts('Menu ID'),
217 'required' => TRUE,
522a26c9 218 'table_name' => 'civicrm_menu',
219 'entity' => 'Menu',
220 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 221 'localizable' => 0,
c3fc2621
CW
222 ],
223 'domain_id' => [
e501603b
TO
224 'name' => 'domain_id',
225 'type' => CRM_Utils_Type::T_INT,
c3fc2621 226 'title' => ts('Domain'),
215b423e 227 'description' => ts('Which Domain is this menu item for'),
c3fc2621 228 'required' => TRUE,
522a26c9 229 'table_name' => 'civicrm_menu',
230 'entity' => 'Menu',
231 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 232 'localizable' => 0,
e501603b 233 'FKClassName' => 'CRM_Core_DAO_Domain',
c3fc2621 234 'pseudoconstant' => [
e501603b
TO
235 'table' => 'civicrm_domain',
236 'keyColumn' => 'id',
237 'labelColumn' => 'name',
c3fc2621
CW
238 ]
239 ],
240 'path' => [
e501603b
TO
241 'name' => 'path',
242 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 243 'title' => ts('Path'),
215b423e 244 'description' => ts('Path Name'),
e501603b
TO
245 'maxlength' => 255,
246 'size' => CRM_Utils_Type::HUGE,
522a26c9 247 'table_name' => 'civicrm_menu',
248 'entity' => 'Menu',
249 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 250 'localizable' => 0,
c3fc2621
CW
251 ],
252 'path_arguments' => [
e501603b
TO
253 'name' => 'path_arguments',
254 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 255 'title' => ts('Arguments'),
215b423e 256 'description' => ts('Arguments to pass to the url'),
522a26c9 257 'table_name' => 'civicrm_menu',
258 'entity' => 'Menu',
259 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 260 'localizable' => 0,
c3fc2621
CW
261 ],
262 'title' => [
e501603b
TO
263 'name' => 'title',
264 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 265 'title' => ts('Menu Title'),
e501603b
TO
266 'maxlength' => 255,
267 'size' => CRM_Utils_Type::HUGE,
522a26c9 268 'table_name' => 'civicrm_menu',
269 'entity' => 'Menu',
270 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 271 'localizable' => 0,
c3fc2621
CW
272 ],
273 'access_callback' => [
e501603b
TO
274 'name' => 'access_callback',
275 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 276 'title' => ts('Access Callback'),
215b423e 277 'description' => ts('Function to call to check access permissions'),
e501603b
TO
278 'maxlength' => 255,
279 'size' => CRM_Utils_Type::HUGE,
522a26c9 280 'table_name' => 'civicrm_menu',
281 'entity' => 'Menu',
282 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 283 'localizable' => 0,
c3fc2621
CW
284 ],
285 'access_arguments' => [
e501603b
TO
286 'name' => 'access_arguments',
287 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 288 'title' => ts('Access Arguments'),
215b423e 289 'description' => ts('Arguments to pass to access callback'),
522a26c9 290 'table_name' => 'civicrm_menu',
291 'entity' => 'Menu',
292 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 293 'localizable' => 0,
c3fc2621
CW
294 ],
295 'page_callback' => [
e501603b
TO
296 'name' => 'page_callback',
297 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 298 'title' => ts('Page Callback'),
215b423e 299 'description' => ts('function to call for this url'),
e501603b
TO
300 'maxlength' => 255,
301 'size' => CRM_Utils_Type::HUGE,
522a26c9 302 'table_name' => 'civicrm_menu',
303 'entity' => 'Menu',
304 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 305 'localizable' => 0,
c3fc2621
CW
306 ],
307 'page_arguments' => [
e501603b
TO
308 'name' => 'page_arguments',
309 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 310 'title' => ts('Page Arguments'),
215b423e 311 'description' => ts('Arguments to pass to page callback'),
522a26c9 312 'table_name' => 'civicrm_menu',
313 'entity' => 'Menu',
314 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 315 'localizable' => 0,
c3fc2621
CW
316 ],
317 'breadcrumb' => [
e501603b
TO
318 'name' => 'breadcrumb',
319 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 320 'title' => ts('Breadcrumb'),
215b423e 321 'description' => ts('Breadcrumb for the path.'),
522a26c9 322 'table_name' => 'civicrm_menu',
323 'entity' => 'Menu',
324 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 325 'localizable' => 0,
c3fc2621
CW
326 ],
327 'return_url' => [
e501603b
TO
328 'name' => 'return_url',
329 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 330 'title' => ts('Return Url'),
215b423e 331 'description' => ts('Url where a page should redirected to, if next url not known.'),
e501603b
TO
332 'maxlength' => 255,
333 'size' => CRM_Utils_Type::HUGE,
522a26c9 334 'table_name' => 'civicrm_menu',
335 'entity' => 'Menu',
336 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 337 'localizable' => 0,
c3fc2621
CW
338 ],
339 'return_url_args' => [
e501603b
TO
340 'name' => 'return_url_args',
341 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 342 'title' => ts('Return Url Args'),
215b423e 343 'description' => ts('Arguments to pass to return_url'),
e501603b
TO
344 'maxlength' => 255,
345 'size' => CRM_Utils_Type::HUGE,
522a26c9 346 'table_name' => 'civicrm_menu',
347 'entity' => 'Menu',
348 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 349 'localizable' => 0,
c3fc2621
CW
350 ],
351 'component_id' => [
e501603b
TO
352 'name' => 'component_id',
353 'type' => CRM_Utils_Type::T_INT,
c3fc2621 354 'title' => ts('Component'),
215b423e 355 'description' => ts('Component that this menu item belongs to'),
522a26c9 356 'table_name' => 'civicrm_menu',
357 'entity' => 'Menu',
358 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 359 'localizable' => 0,
e501603b 360 'FKClassName' => 'CRM_Core_DAO_Component',
c3fc2621 361 'html' => [
e501603b 362 'type' => 'Select',
c3fc2621
CW
363 ],
364 'pseudoconstant' => [
e501603b
TO
365 'table' => 'civicrm_component',
366 'keyColumn' => 'id',
367 'labelColumn' => 'name',
c3fc2621
CW
368 ]
369 ],
370 'is_active' => [
e501603b
TO
371 'name' => 'is_active',
372 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 373 'title' => ts('Enabled?'),
215b423e 374 'description' => ts('Is this menu item active?'),
522a26c9 375 'table_name' => 'civicrm_menu',
376 'entity' => 'Menu',
377 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 378 'localizable' => 0,
c3fc2621
CW
379 ],
380 'is_public' => [
e501603b
TO
381 'name' => 'is_public',
382 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 383 'title' => ts('Public?'),
215b423e 384 'description' => ts('Is this menu accessible to the public?'),
522a26c9 385 'table_name' => 'civicrm_menu',
386 'entity' => 'Menu',
387 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 388 'localizable' => 0,
c3fc2621
CW
389 ],
390 'is_exposed' => [
e501603b
TO
391 'name' => 'is_exposed',
392 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 393 'title' => ts('Exposed?'),
215b423e 394 'description' => ts('Is this menu exposed to the navigation system?'),
522a26c9 395 'table_name' => 'civicrm_menu',
396 'entity' => 'Menu',
397 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 398 'localizable' => 0,
c3fc2621
CW
399 ],
400 'is_ssl' => [
e501603b
TO
401 'name' => 'is_ssl',
402 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 403 'title' => ts('Use SSL?'),
215b423e 404 'description' => ts('Should this menu be exposed via SSL if enabled?'),
522a26c9 405 'table_name' => 'civicrm_menu',
406 'entity' => 'Menu',
407 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 408 'localizable' => 0,
c3fc2621
CW
409 ],
410 'weight' => [
e501603b
TO
411 'name' => 'weight',
412 'type' => CRM_Utils_Type::T_INT,
c3fc2621 413 'title' => ts('Order'),
215b423e 414 'description' => ts('Ordering of the menu items in various blocks.'),
c3fc2621 415 'required' => TRUE,
e501603b 416 'default' => '1',
522a26c9 417 'table_name' => 'civicrm_menu',
418 'entity' => 'Menu',
419 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 420 'localizable' => 0,
c3fc2621
CW
421 ],
422 'type' => [
e501603b
TO
423 'name' => 'type',
424 'type' => CRM_Utils_Type::T_INT,
c3fc2621 425 'title' => ts('Type'),
215b423e 426 'description' => ts('Drupal menu type.'),
c3fc2621 427 'required' => TRUE,
e501603b 428 'default' => '1',
522a26c9 429 'table_name' => 'civicrm_menu',
430 'entity' => 'Menu',
431 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 432 'localizable' => 0,
c3fc2621
CW
433 ],
434 'page_type' => [
e501603b
TO
435 'name' => 'page_type',
436 'type' => CRM_Utils_Type::T_INT,
c3fc2621 437 'title' => ts('Page Type'),
215b423e 438 'description' => ts('CiviCRM menu type.'),
c3fc2621 439 'required' => TRUE,
e501603b 440 'default' => '1',
522a26c9 441 'table_name' => 'civicrm_menu',
442 'entity' => 'Menu',
443 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 444 'localizable' => 0,
c3fc2621
CW
445 ],
446 'skipBreadcrumb' => [
e501603b
TO
447 'name' => 'skipBreadcrumb',
448 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 449 'title' => ts('Hide Breadcrumb?'),
215b423e 450 'description' => ts('skip this url being exposed to breadcrumb'),
522a26c9 451 'table_name' => 'civicrm_menu',
452 'entity' => 'Menu',
b44dc91e
TO
453 'bao' => 'CRM_Core_DAO_Menu',
454 'localizable' => 0,
c3fc2621
CW
455 ],
456 'module_data' => [
b44dc91e
TO
457 'name' => 'module_data',
458 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 459 'title' => ts('Other menu data'),
215b423e 460 'description' => ts('All other menu metadata not stored in other fields'),
b44dc91e
TO
461 'table_name' => 'civicrm_menu',
462 'entity' => 'Menu',
522a26c9 463 'bao' => 'CRM_Core_DAO_Menu',
6a7e5e5d 464 'localizable' => 0,
c3fc2621
CW
465 ],
466 ];
346aaaba 467 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 468 }
346aaaba 469 return Civi::$statics[__CLASS__]['fields'];
e501603b 470 }
c3fc2621 471
e501603b 472 /**
bd8e0b14 473 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
474 *
475 * @return array
bd8e0b14 476 * Array(string $name => string $uniqueName).
e501603b 477 */
c3fc2621 478 public static function &fieldKeys() {
bd8e0b14
TO
479 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
480 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 481 }
bd8e0b14 482 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 483 }
c3fc2621 484
e501603b
TO
485 /**
486 * Returns the names of this table
487 *
488 * @return string
489 */
c3fc2621 490 public static function getTableName() {
e501603b
TO
491 return self::$_tableName;
492 }
c3fc2621 493
e501603b
TO
494 /**
495 * Returns if this table needs to be logged
496 *
c3fc2621 497 * @return bool
e501603b 498 */
c3fc2621 499 public function getLog() {
e501603b
TO
500 return self::$_log;
501 }
c3fc2621 502
e501603b
TO
503 /**
504 * Returns the list of fields that can be imported
505 *
506 * @param bool $prefix
507 *
508 * @return array
509 */
c3fc2621
CW
510 public static function &import($prefix = FALSE) {
511 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'menu', $prefix, []);
60808919 512 return $r;
e501603b 513 }
c3fc2621 514
e501603b
TO
515 /**
516 * Returns the list of fields that can be exported
517 *
518 * @param bool $prefix
519 *
520 * @return array
521 */
c3fc2621
CW
522 public static function &export($prefix = FALSE) {
523 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'menu', $prefix, []);
60808919 524 return $r;
e501603b 525 }
c3fc2621 526
e7a6b91a
AS
527 /**
528 * Returns the list of indices
c3fc2621
CW
529 *
530 * @param bool $localize
531 *
532 * @return array
e7a6b91a
AS
533 */
534 public static function indices($localize = TRUE) {
c3fc2621
CW
535 $indices = [
536 'UI_path_domain_id' => [
e7a6b91a 537 'name' => 'UI_path_domain_id',
c3fc2621 538 'field' => [
e7a6b91a
AS
539 0 => 'path',
540 1 => 'domain_id',
c3fc2621
CW
541 ],
542 'localizable' => FALSE,
543 'unique' => TRUE,
e7a6b91a 544 'sig' => 'civicrm_menu::1::path::domain_id',
c3fc2621
CW
545 ],
546 ];
e7a6b91a
AS
547 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
548 }
c3fc2621 549
e501603b 550}