CRM_Core_CodeGen_DAO::needsUpdate - Compare full code (modulo whitespace)
[civicrm-core.git] / CRM / Core / DAO / Menu.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
6| Copyright CiviCRM LLC (c) 2004-2016 |
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
10| CiviCRM is free software; you can copy, modify, and distribute it |
11| under the terms of the GNU Affero General Public License |
12| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13| |
14| CiviCRM is distributed in the hope that it will be useful, but |
15| WITHOUT ANY WARRANTY; without even the implied warranty of |
16| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17| See the GNU Affero General Public License for more details. |
18| |
19| You should have received a copy of the GNU Affero General Public |
20| License and the CiviCRM Licensing Exception along |
21| with this program; if not, contact CiviCRM LLC |
22| at info[AT]civicrm[DOT]org. If you have questions about the |
23| GNU Affero General Public License or the licensing of CiviCRM, |
24| see the CiviCRM license FAQ at http://civicrm.org/licensing |
25+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Core/Menu.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:ed98e9568ede4fc7953b53b46a72b8db)
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Core_DAO_Menu extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_menu';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static instance to hold the values that can
64 * be imported
65 *
66 * @var array
67 */
68 static $_import = null;
69 /**
70 * static instance to hold the values that can
71 * be exported
72 *
73 * @var array
74 */
75 static $_export = null;
76 /**
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
79 *
80 * @var boolean
81 */
82 static $_log = false;
83 /**
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Which Domain is this menu item for
90 *
91 * @var int unsigned
92 */
93 public $domain_id;
94 /**
95 * Path Name
96 *
97 * @var string
98 */
99 public $path;
100 /**
101 * Arguments to pass to the url
102 *
103 * @var text
104 */
105 public $path_arguments;
106 /**
107 *
108 * @var string
109 */
110 public $title;
111 /**
112 * Function to call to check access permissions
113 *
114 * @var string
115 */
116 public $access_callback;
117 /**
118 * Arguments to pass to access callback
119 *
120 * @var text
121 */
122 public $access_arguments;
123 /**
124 * function to call for this url
125 *
126 * @var string
127 */
128 public $page_callback;
129 /**
130 * Arguments to pass to page callback
131 *
132 * @var text
133 */
134 public $page_arguments;
135 /**
136 * Breadcrumb for the path.
137 *
138 * @var text
139 */
140 public $breadcrumb;
141 /**
142 * Url where a page should redirected to, if next url not known.
143 *
144 * @var string
145 */
146 public $return_url;
147 /**
148 * Arguments to pass to return_url
149 *
150 * @var string
151 */
152 public $return_url_args;
153 /**
154 * Component that this menu item belongs to
155 *
156 * @var int unsigned
157 */
158 public $component_id;
159 /**
160 * Is this menu item active?
161 *
162 * @var boolean
163 */
164 public $is_active;
165 /**
166 * Is this menu accessible to the public?
167 *
168 * @var boolean
169 */
170 public $is_public;
171 /**
172 * Is this menu exposed to the navigation system?
173 *
174 * @var boolean
175 */
176 public $is_exposed;
177 /**
178 * Should this menu be exposed via SSL if enabled?
179 *
180 * @var boolean
181 */
182 public $is_ssl;
183 /**
184 * Ordering of the menu items in various blocks.
185 *
186 * @var int
187 */
188 public $weight;
189 /**
190 * Drupal menu type.
191 *
192 * @var int
193 */
194 public $type;
195 /**
196 * CiviCRM menu type.
197 *
198 * @var int
199 */
200 public $page_type;
201 /**
202 * skip this url being exposed to breadcrumb
203 *
204 * @var boolean
205 */
206 public $skipBreadcrumb;
207 /**
208 * class constructor
209 *
210 * @return civicrm_menu
211 */
212 function __construct() {
213 $this->__table = 'civicrm_menu';
214 parent::__construct();
215 }
216 /**
217 * Returns foreign keys and entity references
218 *
219 * @return array
220 * [CRM_Core_Reference_Interface]
221 */
222 static function getReferenceColumns() {
223 if (!self::$_links) {
224 self::$_links = static ::createReferenceColumns(__CLASS__);
225 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
226 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'component_id', 'civicrm_component', 'id');
227 }
228 return self::$_links;
229 }
230 /**
231 * Returns all the column names of this table
232 *
233 * @return array
234 */
235 static function &fields() {
236 if (!(self::$_fields)) {
237 self::$_fields = array(
238 'id' => array(
239 'name' => 'id',
240 'type' => CRM_Utils_Type::T_INT,
241 'title' => ts('Menu ID') ,
242 'required' => true,
243 ) ,
244 'domain_id' => array(
245 'name' => 'domain_id',
246 'type' => CRM_Utils_Type::T_INT,
247 'title' => ts('Domain') ,
248 'description' => 'Which Domain is this menu item for',
249 'required' => true,
250 'FKClassName' => 'CRM_Core_DAO_Domain',
251 'pseudoconstant' => array(
252 'table' => 'civicrm_domain',
253 'keyColumn' => 'id',
254 'labelColumn' => 'name',
255 )
256 ) ,
257 'path' => array(
258 'name' => 'path',
259 'type' => CRM_Utils_Type::T_STRING,
260 'title' => ts('Path') ,
261 'description' => 'Path Name',
262 'maxlength' => 255,
263 'size' => CRM_Utils_Type::HUGE,
264 ) ,
265 'path_arguments' => array(
266 'name' => 'path_arguments',
267 'type' => CRM_Utils_Type::T_TEXT,
268 'title' => ts('Arguments') ,
269 'description' => 'Arguments to pass to the url',
270 ) ,
271 'title' => array(
272 'name' => 'title',
273 'type' => CRM_Utils_Type::T_STRING,
274 'title' => ts('Menu Title') ,
275 'maxlength' => 255,
276 'size' => CRM_Utils_Type::HUGE,
277 ) ,
278 'access_callback' => array(
279 'name' => 'access_callback',
280 'type' => CRM_Utils_Type::T_STRING,
281 'title' => ts('Access Callback') ,
282 'description' => 'Function to call to check access permissions',
283 'maxlength' => 255,
284 'size' => CRM_Utils_Type::HUGE,
285 ) ,
286 'access_arguments' => array(
287 'name' => 'access_arguments',
288 'type' => CRM_Utils_Type::T_TEXT,
289 'title' => ts('Access Arguments') ,
290 'description' => 'Arguments to pass to access callback',
291 ) ,
292 'page_callback' => array(
293 'name' => 'page_callback',
294 'type' => CRM_Utils_Type::T_STRING,
295 'title' => ts('Page Callback') ,
296 'description' => 'function to call for this url',
297 'maxlength' => 255,
298 'size' => CRM_Utils_Type::HUGE,
299 ) ,
300 'page_arguments' => array(
301 'name' => 'page_arguments',
302 'type' => CRM_Utils_Type::T_TEXT,
303 'title' => ts('Page Arguments') ,
304 'description' => 'Arguments to pass to page callback',
305 ) ,
306 'breadcrumb' => array(
307 'name' => 'breadcrumb',
308 'type' => CRM_Utils_Type::T_TEXT,
309 'title' => ts('Breadcrumb') ,
310 'description' => 'Breadcrumb for the path.',
311 ) ,
312 'return_url' => array(
313 'name' => 'return_url',
314 'type' => CRM_Utils_Type::T_STRING,
315 'title' => ts('Return Url') ,
316 'description' => 'Url where a page should redirected to, if next url not known.',
317 'maxlength' => 255,
318 'size' => CRM_Utils_Type::HUGE,
319 ) ,
320 'return_url_args' => array(
321 'name' => 'return_url_args',
322 'type' => CRM_Utils_Type::T_STRING,
323 'title' => ts('Return Url Args') ,
324 'description' => 'Arguments to pass to return_url',
325 'maxlength' => 255,
326 'size' => CRM_Utils_Type::HUGE,
327 ) ,
328 'component_id' => array(
329 'name' => 'component_id',
330 'type' => CRM_Utils_Type::T_INT,
331 'title' => ts('Component') ,
332 'description' => 'Component that this menu item belongs to',
333 'FKClassName' => 'CRM_Core_DAO_Component',
334 'html' => array(
335 'type' => 'Select',
336 ) ,
337 'pseudoconstant' => array(
338 'table' => 'civicrm_component',
339 'keyColumn' => 'id',
340 'labelColumn' => 'name',
341 )
342 ) ,
343 'is_active' => array(
344 'name' => 'is_active',
345 'type' => CRM_Utils_Type::T_BOOLEAN,
346 'title' => ts('Enabled?') ,
347 'description' => 'Is this menu item active?',
348 ) ,
349 'is_public' => array(
350 'name' => 'is_public',
351 'type' => CRM_Utils_Type::T_BOOLEAN,
352 'title' => ts('Public?') ,
353 'description' => 'Is this menu accessible to the public?',
354 ) ,
355 'is_exposed' => array(
356 'name' => 'is_exposed',
357 'type' => CRM_Utils_Type::T_BOOLEAN,
358 'title' => ts('Exposed?') ,
359 'description' => 'Is this menu exposed to the navigation system?',
360 ) ,
361 'is_ssl' => array(
362 'name' => 'is_ssl',
363 'type' => CRM_Utils_Type::T_BOOLEAN,
364 'title' => ts('Use SSL?') ,
365 'description' => 'Should this menu be exposed via SSL if enabled?',
366 ) ,
367 'weight' => array(
368 'name' => 'weight',
369 'type' => CRM_Utils_Type::T_INT,
370 'title' => ts('Order') ,
371 'description' => 'Ordering of the menu items in various blocks.',
372 'required' => true,
373 'default' => '1',
374 ) ,
375 'type' => array(
376 'name' => 'type',
377 'type' => CRM_Utils_Type::T_INT,
378 'title' => ts('Type') ,
379 'description' => 'Drupal menu type.',
380 'required' => true,
381 'default' => '1',
382 ) ,
383 'page_type' => array(
384 'name' => 'page_type',
385 'type' => CRM_Utils_Type::T_INT,
386 'title' => ts('Page Type') ,
387 'description' => 'CiviCRM menu type.',
388 'required' => true,
389 'default' => '1',
390 ) ,
391 'skipBreadcrumb' => array(
392 'name' => 'skipBreadcrumb',
393 'type' => CRM_Utils_Type::T_BOOLEAN,
394 'title' => ts('Hide Breadcrumb?') ,
395 'description' => 'skip this url being exposed to breadcrumb',
396 ) ,
397 );
398 }
399 return self::$_fields;
400 }
401 /**
402 * Returns an array containing, for each field, the arary key used for that
403 * field in self::$_fields.
404 *
405 * @return array
406 */
407 static function &fieldKeys() {
408 if (!(self::$_fieldKeys)) {
409 self::$_fieldKeys = array(
410 'id' => 'id',
411 'domain_id' => 'domain_id',
412 'path' => 'path',
413 'path_arguments' => 'path_arguments',
414 'title' => 'title',
415 'access_callback' => 'access_callback',
416 'access_arguments' => 'access_arguments',
417 'page_callback' => 'page_callback',
418 'page_arguments' => 'page_arguments',
419 'breadcrumb' => 'breadcrumb',
420 'return_url' => 'return_url',
421 'return_url_args' => 'return_url_args',
422 'component_id' => 'component_id',
423 'is_active' => 'is_active',
424 'is_public' => 'is_public',
425 'is_exposed' => 'is_exposed',
426 'is_ssl' => 'is_ssl',
427 'weight' => 'weight',
428 'type' => 'type',
429 'page_type' => 'page_type',
430 'skipBreadcrumb' => 'skipBreadcrumb',
431 );
432 }
433 return self::$_fieldKeys;
434 }
435 /**
436 * Returns the names of this table
437 *
438 * @return string
439 */
440 static function getTableName() {
441 return self::$_tableName;
442 }
443 /**
444 * Returns if this table needs to be logged
445 *
446 * @return boolean
447 */
448 function getLog() {
449 return self::$_log;
450 }
451 /**
452 * Returns the list of fields that can be imported
453 *
454 * @param bool $prefix
455 *
456 * @return array
457 */
458 static function &import($prefix = false) {
459 if (!(self::$_import)) {
460 self::$_import = array();
461 $fields = self::fields();
462 foreach($fields as $name => $field) {
463 if (CRM_Utils_Array::value('import', $field)) {
464 if ($prefix) {
465 self::$_import['menu'] = & $fields[$name];
466 } else {
467 self::$_import[$name] = & $fields[$name];
468 }
469 }
470 }
471 }
472 return self::$_import;
473 }
474 /**
475 * Returns the list of fields that can be exported
476 *
477 * @param bool $prefix
478 *
479 * @return array
480 */
481 static function &export($prefix = false) {
482 if (!(self::$_export)) {
483 self::$_export = array();
484 $fields = self::fields();
485 foreach($fields as $name => $field) {
486 if (CRM_Utils_Array::value('export', $field)) {
487 if ($prefix) {
488 self::$_export['menu'] = & $fields[$name];
489 } else {
490 self::$_export[$name] = & $fields[$name];
491 }
492 }
493 }
494 }
495 return self::$_export;
496 }
497}