Merge pull request #8944 from totten/master-givi
[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
437fafcf 33 * (GenCodeChecksum:cde2f8bb660dfd2d166e6a3a6c231178)
e501603b
TO
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';
e501603b
TO
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = false;
51 /**
52 *
53 * @var int unsigned
54 */
55 public $id;
56 /**
57 * Which Domain is this menu item for
58 *
59 * @var int unsigned
60 */
61 public $domain_id;
62 /**
63 * Path Name
64 *
65 * @var string
66 */
67 public $path;
68 /**
69 * Arguments to pass to the url
70 *
71 * @var text
72 */
73 public $path_arguments;
74 /**
75 *
76 * @var string
77 */
78 public $title;
79 /**
80 * Function to call to check access permissions
81 *
82 * @var string
83 */
84 public $access_callback;
85 /**
86 * Arguments to pass to access callback
87 *
88 * @var text
89 */
90 public $access_arguments;
91 /**
92 * function to call for this url
93 *
94 * @var string
95 */
96 public $page_callback;
97 /**
98 * Arguments to pass to page callback
99 *
100 * @var text
101 */
102 public $page_arguments;
103 /**
104 * Breadcrumb for the path.
105 *
106 * @var text
107 */
108 public $breadcrumb;
109 /**
110 * Url where a page should redirected to, if next url not known.
111 *
112 * @var string
113 */
114 public $return_url;
115 /**
116 * Arguments to pass to return_url
117 *
118 * @var string
119 */
120 public $return_url_args;
121 /**
122 * Component that this menu item belongs to
123 *
124 * @var int unsigned
125 */
126 public $component_id;
127 /**
128 * Is this menu item active?
129 *
130 * @var boolean
131 */
132 public $is_active;
133 /**
134 * Is this menu accessible to the public?
135 *
136 * @var boolean
137 */
138 public $is_public;
139 /**
140 * Is this menu exposed to the navigation system?
141 *
142 * @var boolean
143 */
144 public $is_exposed;
145 /**
146 * Should this menu be exposed via SSL if enabled?
147 *
148 * @var boolean
149 */
150 public $is_ssl;
151 /**
152 * Ordering of the menu items in various blocks.
153 *
154 * @var int
155 */
156 public $weight;
157 /**
158 * Drupal menu type.
159 *
160 * @var int
161 */
162 public $type;
163 /**
164 * CiviCRM menu type.
165 *
166 * @var int
167 */
168 public $page_type;
169 /**
170 * skip this url being exposed to breadcrumb
171 *
172 * @var boolean
173 */
174 public $skipBreadcrumb;
175 /**
176 * class constructor
177 *
178 * @return civicrm_menu
179 */
180 function __construct() {
181 $this->__table = 'civicrm_menu';
182 parent::__construct();
183 }
184 /**
185 * Returns foreign keys and entity references
186 *
187 * @return array
188 * [CRM_Core_Reference_Interface]
189 */
190 static function getReferenceColumns() {
346aaaba
TO
191 if (!isset(Civi::$statics[__CLASS__]['links'])) {
192 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
193 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
194 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'component_id', 'civicrm_component', 'id');
195 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 196 }
346aaaba 197 return Civi::$statics[__CLASS__]['links'];
e501603b
TO
198 }
199 /**
200 * Returns all the column names of this table
201 *
202 * @return array
203 */
204 static function &fields() {
346aaaba
TO
205 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
206 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
207 'id' => array(
208 'name' => 'id',
209 'type' => CRM_Utils_Type::T_INT,
210 'title' => ts('Menu ID') ,
211 'required' => true,
212 ) ,
213 'domain_id' => array(
214 'name' => 'domain_id',
215 'type' => CRM_Utils_Type::T_INT,
216 'title' => ts('Domain') ,
217 'description' => 'Which Domain is this menu item for',
218 'required' => true,
219 'FKClassName' => 'CRM_Core_DAO_Domain',
220 'pseudoconstant' => array(
221 'table' => 'civicrm_domain',
222 'keyColumn' => 'id',
223 'labelColumn' => 'name',
224 )
225 ) ,
226 'path' => array(
227 'name' => 'path',
228 'type' => CRM_Utils_Type::T_STRING,
229 'title' => ts('Path') ,
230 'description' => 'Path Name',
231 'maxlength' => 255,
232 'size' => CRM_Utils_Type::HUGE,
233 ) ,
234 'path_arguments' => array(
235 'name' => 'path_arguments',
236 'type' => CRM_Utils_Type::T_TEXT,
237 'title' => ts('Arguments') ,
238 'description' => 'Arguments to pass to the url',
239 ) ,
240 'title' => array(
241 'name' => 'title',
242 'type' => CRM_Utils_Type::T_STRING,
243 'title' => ts('Menu Title') ,
244 'maxlength' => 255,
245 'size' => CRM_Utils_Type::HUGE,
246 ) ,
247 'access_callback' => array(
248 'name' => 'access_callback',
249 'type' => CRM_Utils_Type::T_STRING,
250 'title' => ts('Access Callback') ,
251 'description' => 'Function to call to check access permissions',
252 'maxlength' => 255,
253 'size' => CRM_Utils_Type::HUGE,
254 ) ,
255 'access_arguments' => array(
256 'name' => 'access_arguments',
257 'type' => CRM_Utils_Type::T_TEXT,
258 'title' => ts('Access Arguments') ,
259 'description' => 'Arguments to pass to access callback',
260 ) ,
261 'page_callback' => array(
262 'name' => 'page_callback',
263 'type' => CRM_Utils_Type::T_STRING,
264 'title' => ts('Page Callback') ,
265 'description' => 'function to call for this url',
266 'maxlength' => 255,
267 'size' => CRM_Utils_Type::HUGE,
268 ) ,
269 'page_arguments' => array(
270 'name' => 'page_arguments',
271 'type' => CRM_Utils_Type::T_TEXT,
272 'title' => ts('Page Arguments') ,
273 'description' => 'Arguments to pass to page callback',
274 ) ,
275 'breadcrumb' => array(
276 'name' => 'breadcrumb',
277 'type' => CRM_Utils_Type::T_TEXT,
278 'title' => ts('Breadcrumb') ,
279 'description' => 'Breadcrumb for the path.',
280 ) ,
281 'return_url' => array(
282 'name' => 'return_url',
283 'type' => CRM_Utils_Type::T_STRING,
284 'title' => ts('Return Url') ,
285 'description' => 'Url where a page should redirected to, if next url not known.',
286 'maxlength' => 255,
287 'size' => CRM_Utils_Type::HUGE,
288 ) ,
289 'return_url_args' => array(
290 'name' => 'return_url_args',
291 'type' => CRM_Utils_Type::T_STRING,
292 'title' => ts('Return Url Args') ,
293 'description' => 'Arguments to pass to return_url',
294 'maxlength' => 255,
295 'size' => CRM_Utils_Type::HUGE,
296 ) ,
297 'component_id' => array(
298 'name' => 'component_id',
299 'type' => CRM_Utils_Type::T_INT,
300 'title' => ts('Component') ,
301 'description' => 'Component that this menu item belongs to',
302 'FKClassName' => 'CRM_Core_DAO_Component',
303 'html' => array(
304 'type' => 'Select',
305 ) ,
306 'pseudoconstant' => array(
307 'table' => 'civicrm_component',
308 'keyColumn' => 'id',
309 'labelColumn' => 'name',
310 )
311 ) ,
312 'is_active' => array(
313 'name' => 'is_active',
314 'type' => CRM_Utils_Type::T_BOOLEAN,
315 'title' => ts('Enabled?') ,
316 'description' => 'Is this menu item active?',
317 ) ,
318 'is_public' => array(
319 'name' => 'is_public',
320 'type' => CRM_Utils_Type::T_BOOLEAN,
321 'title' => ts('Public?') ,
322 'description' => 'Is this menu accessible to the public?',
323 ) ,
324 'is_exposed' => array(
325 'name' => 'is_exposed',
326 'type' => CRM_Utils_Type::T_BOOLEAN,
327 'title' => ts('Exposed?') ,
328 'description' => 'Is this menu exposed to the navigation system?',
329 ) ,
330 'is_ssl' => array(
331 'name' => 'is_ssl',
332 'type' => CRM_Utils_Type::T_BOOLEAN,
333 'title' => ts('Use SSL?') ,
334 'description' => 'Should this menu be exposed via SSL if enabled?',
335 ) ,
336 'weight' => array(
337 'name' => 'weight',
338 'type' => CRM_Utils_Type::T_INT,
339 'title' => ts('Order') ,
340 'description' => 'Ordering of the menu items in various blocks.',
341 'required' => true,
342 'default' => '1',
343 ) ,
344 'type' => array(
345 'name' => 'type',
346 'type' => CRM_Utils_Type::T_INT,
347 'title' => ts('Type') ,
348 'description' => 'Drupal menu type.',
349 'required' => true,
350 'default' => '1',
351 ) ,
352 'page_type' => array(
353 'name' => 'page_type',
354 'type' => CRM_Utils_Type::T_INT,
355 'title' => ts('Page Type') ,
356 'description' => 'CiviCRM menu type.',
357 'required' => true,
358 'default' => '1',
359 ) ,
360 'skipBreadcrumb' => array(
361 'name' => 'skipBreadcrumb',
362 'type' => CRM_Utils_Type::T_BOOLEAN,
363 'title' => ts('Hide Breadcrumb?') ,
364 'description' => 'skip this url being exposed to breadcrumb',
365 ) ,
366 );
346aaaba 367 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 368 }
346aaaba 369 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
370 }
371 /**
bd8e0b14 372 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
373 *
374 * @return array
bd8e0b14 375 * Array(string $name => string $uniqueName).
e501603b
TO
376 */
377 static function &fieldKeys() {
bd8e0b14
TO
378 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
379 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 380 }
bd8e0b14 381 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
382 }
383 /**
384 * Returns the names of this table
385 *
386 * @return string
387 */
388 static function getTableName() {
389 return self::$_tableName;
390 }
391 /**
392 * Returns if this table needs to be logged
393 *
394 * @return boolean
395 */
396 function getLog() {
397 return self::$_log;
398 }
399 /**
400 * Returns the list of fields that can be imported
401 *
402 * @param bool $prefix
403 *
404 * @return array
405 */
406 static function &import($prefix = false) {
60808919
TO
407 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'menu', $prefix, array());
408 return $r;
e501603b
TO
409 }
410 /**
411 * Returns the list of fields that can be exported
412 *
413 * @param bool $prefix
414 *
415 * @return array
416 */
417 static function &export($prefix = false) {
60808919
TO
418 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'menu', $prefix, array());
419 return $r;
e501603b
TO
420 }
421}