Merge pull request #8916 from cividesk/CRM-19256-4.7
[civicrm-core.git] / CRM / Core / DAO / Menu.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
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
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
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';
f41f0342 37/**
38 * CRM_Core_DAO_Menu constructor.
39 */
e501603b
TO
40class CRM_Core_DAO_Menu extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_menu';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 *
55 * @var int unsigned
56 */
57 public $id;
58 /**
59 * Which Domain is this menu item for
60 *
61 * @var int unsigned
62 */
63 public $domain_id;
64 /**
65 * Path Name
66 *
67 * @var string
68 */
69 public $path;
70 /**
71 * Arguments to pass to the url
72 *
73 * @var text
74 */
75 public $path_arguments;
76 /**
77 *
78 * @var string
79 */
80 public $title;
81 /**
82 * Function to call to check access permissions
83 *
84 * @var string
85 */
86 public $access_callback;
87 /**
88 * Arguments to pass to access callback
89 *
90 * @var text
91 */
92 public $access_arguments;
93 /**
94 * function to call for this url
95 *
96 * @var string
97 */
98 public $page_callback;
99 /**
100 * Arguments to pass to page callback
101 *
102 * @var text
103 */
104 public $page_arguments;
105 /**
106 * Breadcrumb for the path.
107 *
108 * @var text
109 */
110 public $breadcrumb;
111 /**
112 * Url where a page should redirected to, if next url not known.
113 *
114 * @var string
115 */
116 public $return_url;
117 /**
118 * Arguments to pass to return_url
119 *
120 * @var string
121 */
122 public $return_url_args;
123 /**
124 * Component that this menu item belongs to
125 *
126 * @var int unsigned
127 */
128 public $component_id;
129 /**
130 * Is this menu item active?
131 *
132 * @var boolean
133 */
134 public $is_active;
135 /**
136 * Is this menu accessible to the public?
137 *
138 * @var boolean
139 */
140 public $is_public;
141 /**
142 * Is this menu exposed to the navigation system?
143 *
144 * @var boolean
145 */
146 public $is_exposed;
147 /**
148 * Should this menu be exposed via SSL if enabled?
149 *
150 * @var boolean
151 */
152 public $is_ssl;
153 /**
154 * Ordering of the menu items in various blocks.
155 *
156 * @var int
157 */
158 public $weight;
159 /**
160 * Drupal menu type.
161 *
162 * @var int
163 */
164 public $type;
165 /**
166 * CiviCRM menu type.
167 *
168 * @var int
169 */
170 public $page_type;
171 /**
172 * skip this url being exposed to breadcrumb
173 *
174 * @var boolean
175 */
176 public $skipBreadcrumb;
177 /**
f41f0342 178 * Class constructor.
e501603b
TO
179 */
180 function __construct() {
181 $this->__table = 'civicrm_menu';
182 parent::__construct();
183 }
184 /**
f41f0342 185 * Returns foreign keys and entity references.
e501603b
TO
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}