Merge pull request #13257 from vinuvarshith/BASW-316-unable-to-mark-price-set-as...
[civicrm-core.git] / CRM / Core / DAO / Navigation.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Core/Navigation.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:f168de98d6c4d46c63abfd789f6fdf24)
10 */
11
12 /**
13 * Database access object for the Navigation entity.
14 */
15 class CRM_Core_DAO_Navigation extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_navigation';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 static $_log = FALSE;
30
31 /**
32 * @var int unsigned
33 */
34 public $id;
35
36 /**
37 * Which Domain is this navigation item for
38 *
39 * @var int unsigned
40 */
41 public $domain_id;
42
43 /**
44 * Navigation Title
45 *
46 * @var string
47 */
48 public $label;
49
50 /**
51 * Internal Name
52 *
53 * @var string
54 */
55 public $name;
56
57 /**
58 * url in case of custom navigation link
59 *
60 * @var string
61 */
62 public $url;
63
64 /**
65 * CSS class name for an icon
66 *
67 * @var string
68 */
69 public $icon;
70
71 /**
72 * Permission for menu item
73 *
74 * @var string
75 */
76 public $permission;
77
78 /**
79 * Permission Operator
80 *
81 * @var string
82 */
83 public $permission_operator;
84
85 /**
86 * Parent navigation item, used for grouping
87 *
88 * @var int unsigned
89 */
90 public $parent_id;
91
92 /**
93 * Is this navigation item active?
94 *
95 * @var boolean
96 */
97 public $is_active;
98
99 /**
100 * If separator needs to be added after this menu item
101 *
102 * @var boolean
103 */
104 public $has_separator;
105
106 /**
107 * Ordering of the navigation items in various blocks.
108 *
109 * @var int
110 */
111 public $weight;
112
113 /**
114 * Class constructor.
115 */
116 public function __construct() {
117 $this->__table = 'civicrm_navigation';
118 parent::__construct();
119 }
120
121 /**
122 * Returns foreign keys and entity references.
123 *
124 * @return array
125 * [CRM_Core_Reference_Interface]
126 */
127 public static function getReferenceColumns() {
128 if (!isset(Civi::$statics[__CLASS__]['links'])) {
129 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
130 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
131 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'parent_id', 'civicrm_navigation', 'id');
132 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
133 }
134 return Civi::$statics[__CLASS__]['links'];
135 }
136
137 /**
138 * Returns all the column names of this table
139 *
140 * @return array
141 */
142 public static function &fields() {
143 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
144 Civi::$statics[__CLASS__]['fields'] = [
145 'id' => [
146 'name' => 'id',
147 'type' => CRM_Utils_Type::T_INT,
148 'title' => ts('Navigation ID'),
149 'required' => TRUE,
150 'table_name' => 'civicrm_navigation',
151 'entity' => 'Navigation',
152 'bao' => 'CRM_Core_BAO_Navigation',
153 'localizable' => 0,
154 ],
155 'domain_id' => [
156 'name' => 'domain_id',
157 'type' => CRM_Utils_Type::T_INT,
158 'title' => ts('Navigation Domain'),
159 'description' => ts('Which Domain is this navigation item for'),
160 'required' => TRUE,
161 'table_name' => 'civicrm_navigation',
162 'entity' => 'Navigation',
163 'bao' => 'CRM_Core_BAO_Navigation',
164 'localizable' => 0,
165 'FKClassName' => 'CRM_Core_DAO_Domain',
166 'pseudoconstant' => [
167 'table' => 'civicrm_domain',
168 'keyColumn' => 'id',
169 'labelColumn' => 'name',
170 ]
171 ],
172 'label' => [
173 'name' => 'label',
174 'type' => CRM_Utils_Type::T_STRING,
175 'title' => ts('Navigation Item Label'),
176 'description' => ts('Navigation Title'),
177 'maxlength' => 255,
178 'size' => CRM_Utils_Type::HUGE,
179 'table_name' => 'civicrm_navigation',
180 'entity' => 'Navigation',
181 'bao' => 'CRM_Core_BAO_Navigation',
182 'localizable' => 0,
183 ],
184 'name' => [
185 'name' => 'name',
186 'type' => CRM_Utils_Type::T_STRING,
187 'title' => ts('Navigation Item Machine Name'),
188 'description' => ts('Internal Name'),
189 'maxlength' => 255,
190 'size' => CRM_Utils_Type::HUGE,
191 'table_name' => 'civicrm_navigation',
192 'entity' => 'Navigation',
193 'bao' => 'CRM_Core_BAO_Navigation',
194 'localizable' => 0,
195 ],
196 'url' => [
197 'name' => 'url',
198 'type' => CRM_Utils_Type::T_STRING,
199 'title' => ts('Url'),
200 'description' => ts('url in case of custom navigation link'),
201 'maxlength' => 255,
202 'size' => CRM_Utils_Type::HUGE,
203 'table_name' => 'civicrm_navigation',
204 'entity' => 'Navigation',
205 'bao' => 'CRM_Core_BAO_Navigation',
206 'localizable' => 0,
207 ],
208 'icon' => [
209 'name' => 'icon',
210 'type' => CRM_Utils_Type::T_STRING,
211 'title' => ts('Icon'),
212 'description' => ts('CSS class name for an icon'),
213 'required' => FALSE,
214 'maxlength' => 255,
215 'size' => CRM_Utils_Type::HUGE,
216 'default' => 'NULL',
217 'table_name' => 'civicrm_navigation',
218 'entity' => 'Navigation',
219 'bao' => 'CRM_Core_BAO_Navigation',
220 'localizable' => 0,
221 ],
222 'permission' => [
223 'name' => 'permission',
224 'type' => CRM_Utils_Type::T_STRING,
225 'title' => ts('Required Permission'),
226 'description' => ts('Permission for menu item'),
227 'maxlength' => 255,
228 'size' => CRM_Utils_Type::HUGE,
229 'table_name' => 'civicrm_navigation',
230 'entity' => 'Navigation',
231 'bao' => 'CRM_Core_BAO_Navigation',
232 'localizable' => 0,
233 ],
234 'permission_operator' => [
235 'name' => 'permission_operator',
236 'type' => CRM_Utils_Type::T_STRING,
237 'title' => ts('Permission Operator'),
238 'description' => ts('Permission Operator'),
239 'maxlength' => 3,
240 'size' => CRM_Utils_Type::FOUR,
241 'table_name' => 'civicrm_navigation',
242 'entity' => 'Navigation',
243 'bao' => 'CRM_Core_BAO_Navigation',
244 'localizable' => 0,
245 ],
246 'parent_id' => [
247 'name' => 'parent_id',
248 'type' => CRM_Utils_Type::T_INT,
249 'title' => ts('Navigation parent ID'),
250 'description' => ts('Parent navigation item, used for grouping'),
251 'table_name' => 'civicrm_navigation',
252 'entity' => 'Navigation',
253 'bao' => 'CRM_Core_BAO_Navigation',
254 'localizable' => 0,
255 'FKClassName' => 'CRM_Core_DAO_Navigation',
256 'pseudoconstant' => [
257 'table' => 'civicrm_navigation',
258 'keyColumn' => 'id',
259 'labelColumn' => 'label',
260 'nameColumn' => 'name',
261 ]
262 ],
263 'is_active' => [
264 'name' => 'is_active',
265 'type' => CRM_Utils_Type::T_BOOLEAN,
266 'title' => ts('Is Active'),
267 'description' => ts('Is this navigation item active?'),
268 'table_name' => 'civicrm_navigation',
269 'entity' => 'Navigation',
270 'bao' => 'CRM_Core_BAO_Navigation',
271 'localizable' => 0,
272 ],
273 'has_separator' => [
274 'name' => 'has_separator',
275 'type' => CRM_Utils_Type::T_BOOLEAN,
276 'title' => ts('Use separator'),
277 'description' => ts('If separator needs to be added after this menu item'),
278 'table_name' => 'civicrm_navigation',
279 'entity' => 'Navigation',
280 'bao' => 'CRM_Core_BAO_Navigation',
281 'localizable' => 0,
282 ],
283 'weight' => [
284 'name' => 'weight',
285 'type' => CRM_Utils_Type::T_INT,
286 'title' => ts('Order'),
287 'description' => ts('Ordering of the navigation items in various blocks.'),
288 'table_name' => 'civicrm_navigation',
289 'entity' => 'Navigation',
290 'bao' => 'CRM_Core_BAO_Navigation',
291 'localizable' => 0,
292 ],
293 ];
294 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
295 }
296 return Civi::$statics[__CLASS__]['fields'];
297 }
298
299 /**
300 * Return a mapping from field-name to the corresponding key (as used in fields()).
301 *
302 * @return array
303 * Array(string $name => string $uniqueName).
304 */
305 public static function &fieldKeys() {
306 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
307 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
308 }
309 return Civi::$statics[__CLASS__]['fieldKeys'];
310 }
311
312 /**
313 * Returns the names of this table
314 *
315 * @return string
316 */
317 public static function getTableName() {
318 return self::$_tableName;
319 }
320
321 /**
322 * Returns if this table needs to be logged
323 *
324 * @return bool
325 */
326 public function getLog() {
327 return self::$_log;
328 }
329
330 /**
331 * Returns the list of fields that can be imported
332 *
333 * @param bool $prefix
334 *
335 * @return array
336 */
337 public static function &import($prefix = FALSE) {
338 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'navigation', $prefix, []);
339 return $r;
340 }
341
342 /**
343 * Returns the list of fields that can be exported
344 *
345 * @param bool $prefix
346 *
347 * @return array
348 */
349 public static function &export($prefix = FALSE) {
350 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'navigation', $prefix, []);
351 return $r;
352 }
353
354 /**
355 * Returns the list of indices
356 *
357 * @param bool $localize
358 *
359 * @return array
360 */
361 public static function indices($localize = TRUE) {
362 $indices = [];
363 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
364 }
365
366 }