Regen DAOs with new import() / export()
[civicrm-core.git] / CRM / Core / DAO / Navigation.php
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/Navigation.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:28492fb431c3874453b53d0af4e3834a)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_Navigation extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_navigation';
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 value to see if we should log any modifications to
64 * this table in the civicrm_log table
65 *
66 * @var boolean
67 */
68 static $_log = false;
69 /**
70 *
71 * @var int unsigned
72 */
73 public $id;
74 /**
75 * Which Domain is this navigation item for
76 *
77 * @var int unsigned
78 */
79 public $domain_id;
80 /**
81 * Navigation Title
82 *
83 * @var string
84 */
85 public $label;
86 /**
87 * Internal Name
88 *
89 * @var string
90 */
91 public $name;
92 /**
93 * url in case of custom navigation link
94 *
95 * @var string
96 */
97 public $url;
98 /**
99 * Permission for menu item
100 *
101 * @var string
102 */
103 public $permission;
104 /**
105 * Permission Operator
106 *
107 * @var string
108 */
109 public $permission_operator;
110 /**
111 * Parent navigation item, used for grouping
112 *
113 * @var int unsigned
114 */
115 public $parent_id;
116 /**
117 * Is this navigation item active?
118 *
119 * @var boolean
120 */
121 public $is_active;
122 /**
123 * If separator needs to be added after this menu item
124 *
125 * @var boolean
126 */
127 public $has_separator;
128 /**
129 * Ordering of the navigation items in various blocks.
130 *
131 * @var int
132 */
133 public $weight;
134 /**
135 * class constructor
136 *
137 * @return civicrm_navigation
138 */
139 function __construct() {
140 $this->__table = 'civicrm_navigation';
141 parent::__construct();
142 }
143 /**
144 * Returns foreign keys and entity references
145 *
146 * @return array
147 * [CRM_Core_Reference_Interface]
148 */
149 static function getReferenceColumns() {
150 if (!self::$_links) {
151 self::$_links = static ::createReferenceColumns(__CLASS__);
152 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
153 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_navigation', 'id');
154 }
155 return self::$_links;
156 }
157 /**
158 * Returns all the column names of this table
159 *
160 * @return array
161 */
162 static function &fields() {
163 if (!(self::$_fields)) {
164 self::$_fields = array(
165 'id' => array(
166 'name' => 'id',
167 'type' => CRM_Utils_Type::T_INT,
168 'title' => ts('Navigation ID') ,
169 'required' => true,
170 ) ,
171 'domain_id' => array(
172 'name' => 'domain_id',
173 'type' => CRM_Utils_Type::T_INT,
174 'title' => ts('Navigation Domain') ,
175 'description' => 'Which Domain is this navigation item for',
176 'required' => true,
177 'FKClassName' => 'CRM_Core_DAO_Domain',
178 'pseudoconstant' => array(
179 'table' => 'civicrm_domain',
180 'keyColumn' => 'id',
181 'labelColumn' => 'name',
182 )
183 ) ,
184 'label' => array(
185 'name' => 'label',
186 'type' => CRM_Utils_Type::T_STRING,
187 'title' => ts('Navigation Item Label') ,
188 'description' => 'Navigation Title',
189 'maxlength' => 255,
190 'size' => CRM_Utils_Type::HUGE,
191 ) ,
192 'name' => array(
193 'name' => 'name',
194 'type' => CRM_Utils_Type::T_STRING,
195 'title' => ts('Navigation Item Machine Name') ,
196 'description' => 'Internal Name',
197 'maxlength' => 255,
198 'size' => CRM_Utils_Type::HUGE,
199 ) ,
200 'url' => array(
201 'name' => 'url',
202 'type' => CRM_Utils_Type::T_STRING,
203 'title' => ts('Url') ,
204 'description' => 'url in case of custom navigation link',
205 'maxlength' => 255,
206 'size' => CRM_Utils_Type::HUGE,
207 ) ,
208 'permission' => array(
209 'name' => 'permission',
210 'type' => CRM_Utils_Type::T_STRING,
211 'title' => ts('Required Permission') ,
212 'description' => 'Permission for menu item',
213 'maxlength' => 255,
214 'size' => CRM_Utils_Type::HUGE,
215 ) ,
216 'permission_operator' => array(
217 'name' => 'permission_operator',
218 'type' => CRM_Utils_Type::T_STRING,
219 'title' => ts('Permission Operator') ,
220 'description' => 'Permission Operator',
221 'maxlength' => 3,
222 'size' => CRM_Utils_Type::FOUR,
223 ) ,
224 'parent_id' => array(
225 'name' => 'parent_id',
226 'type' => CRM_Utils_Type::T_INT,
227 'title' => ts('Navigation parent ID') ,
228 'description' => 'Parent navigation item, used for grouping',
229 'FKClassName' => 'CRM_Core_DAO_Navigation',
230 'pseudoconstant' => array(
231 'table' => 'civicrm_navigation',
232 'keyColumn' => 'name',
233 'labelColumn' => 'label',
234 )
235 ) ,
236 'is_active' => array(
237 'name' => 'is_active',
238 'type' => CRM_Utils_Type::T_BOOLEAN,
239 'title' => ts('Is Active') ,
240 'description' => 'Is this navigation item active?',
241 ) ,
242 'has_separator' => array(
243 'name' => 'has_separator',
244 'type' => CRM_Utils_Type::T_BOOLEAN,
245 'title' => ts('Use separator') ,
246 'description' => 'If separator needs to be added after this menu item',
247 ) ,
248 'weight' => array(
249 'name' => 'weight',
250 'type' => CRM_Utils_Type::T_INT,
251 'title' => ts('Order') ,
252 'description' => 'Ordering of the navigation items in various blocks.',
253 ) ,
254 );
255 }
256 return self::$_fields;
257 }
258 /**
259 * Returns an array containing, for each field, the arary key used for that
260 * field in self::$_fields.
261 *
262 * @return array
263 */
264 static function &fieldKeys() {
265 if (!(self::$_fieldKeys)) {
266 self::$_fieldKeys = array(
267 'id' => 'id',
268 'domain_id' => 'domain_id',
269 'label' => 'label',
270 'name' => 'name',
271 'url' => 'url',
272 'permission' => 'permission',
273 'permission_operator' => 'permission_operator',
274 'parent_id' => 'parent_id',
275 'is_active' => 'is_active',
276 'has_separator' => 'has_separator',
277 'weight' => 'weight',
278 );
279 }
280 return self::$_fieldKeys;
281 }
282 /**
283 * Returns the names of this table
284 *
285 * @return string
286 */
287 static function getTableName() {
288 return self::$_tableName;
289 }
290 /**
291 * Returns if this table needs to be logged
292 *
293 * @return boolean
294 */
295 function getLog() {
296 return self::$_log;
297 }
298 /**
299 * Returns the list of fields that can be imported
300 *
301 * @param bool $prefix
302 *
303 * @return array
304 */
305 static function &import($prefix = false) {
306 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'navigation', $prefix, array());
307 return $r;
308 }
309 /**
310 * Returns the list of fields that can be exported
311 *
312 * @param bool $prefix
313 *
314 * @return array
315 */
316 static function &export($prefix = false) {
317 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'navigation', $prefix, array());
318 return $r;
319 }
320 }