3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Core/Navigation.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:50047b21bb89d424e7852ea198e521fc)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_Navigation constructor.
40 class CRM_Core_DAO_Navigation
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_navigation';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
59 * Which Domain is this navigation item for
77 * url in case of custom navigation link
83 * Permission for menu item
93 public $permission_operator;
95 * Parent navigation item, used for grouping
101 * Is this navigation item active?
107 * If separator needs to be added after this menu item
111 public $has_separator;
113 * Ordering of the navigation items in various blocks.
121 function __construct() {
122 $this->__table
= 'civicrm_navigation';
123 parent
::__construct();
126 * Returns foreign keys and entity references.
129 * [CRM_Core_Reference_Interface]
131 static function getReferenceColumns() {
132 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
133 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
134 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'domain_id', 'civicrm_domain', 'id');
135 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'parent_id', 'civicrm_navigation', 'id');
136 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
138 return Civi
::$statics[__CLASS__
]['links'];
141 * Returns all the column names of this table
145 static function &fields() {
146 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
147 Civi
::$statics[__CLASS__
]['fields'] = array(
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Navigation ID') ,
153 'table_name' => 'civicrm_navigation',
154 'entity' => 'Navigation',
155 'bao' => 'CRM_Core_BAO_Navigation',
158 'domain_id' => array(
159 'name' => 'domain_id',
160 'type' => CRM_Utils_Type
::T_INT
,
161 'title' => ts('Navigation Domain') ,
162 'description' => 'Which Domain is this navigation item for',
164 'table_name' => 'civicrm_navigation',
165 'entity' => 'Navigation',
166 'bao' => 'CRM_Core_BAO_Navigation',
168 'FKClassName' => 'CRM_Core_DAO_Domain',
169 'pseudoconstant' => array(
170 'table' => 'civicrm_domain',
172 'labelColumn' => 'name',
177 'type' => CRM_Utils_Type
::T_STRING
,
178 'title' => ts('Navigation Item Label') ,
179 'description' => 'Navigation Title',
181 'size' => CRM_Utils_Type
::HUGE
,
182 'table_name' => 'civicrm_navigation',
183 'entity' => 'Navigation',
184 'bao' => 'CRM_Core_BAO_Navigation',
189 'type' => CRM_Utils_Type
::T_STRING
,
190 'title' => ts('Navigation Item Machine Name') ,
191 'description' => 'Internal Name',
193 'size' => CRM_Utils_Type
::HUGE
,
194 'table_name' => 'civicrm_navigation',
195 'entity' => 'Navigation',
196 'bao' => 'CRM_Core_BAO_Navigation',
201 'type' => CRM_Utils_Type
::T_STRING
,
202 'title' => ts('Url') ,
203 'description' => 'url in case of custom navigation link',
205 'size' => CRM_Utils_Type
::HUGE
,
206 'table_name' => 'civicrm_navigation',
207 'entity' => 'Navigation',
208 'bao' => 'CRM_Core_BAO_Navigation',
211 'permission' => array(
212 'name' => 'permission',
213 'type' => CRM_Utils_Type
::T_STRING
,
214 'title' => ts('Required Permission') ,
215 'description' => 'Permission for menu item',
217 'size' => CRM_Utils_Type
::HUGE
,
218 'table_name' => 'civicrm_navigation',
219 'entity' => 'Navigation',
220 'bao' => 'CRM_Core_BAO_Navigation',
223 'permission_operator' => array(
224 'name' => 'permission_operator',
225 'type' => CRM_Utils_Type
::T_STRING
,
226 'title' => ts('Permission Operator') ,
227 'description' => 'Permission Operator',
229 'size' => CRM_Utils_Type
::FOUR
,
230 'table_name' => 'civicrm_navigation',
231 'entity' => 'Navigation',
232 'bao' => 'CRM_Core_BAO_Navigation',
235 'parent_id' => array(
236 'name' => 'parent_id',
237 'type' => CRM_Utils_Type
::T_INT
,
238 'title' => ts('Navigation parent ID') ,
239 'description' => 'Parent navigation item, used for grouping',
240 'table_name' => 'civicrm_navigation',
241 'entity' => 'Navigation',
242 'bao' => 'CRM_Core_BAO_Navigation',
244 'FKClassName' => 'CRM_Core_DAO_Navigation',
245 'pseudoconstant' => array(
246 'table' => 'civicrm_navigation',
248 'labelColumn' => 'label',
249 'nameColumn' => 'name',
252 'is_active' => array(
253 'name' => 'is_active',
254 'type' => CRM_Utils_Type
::T_BOOLEAN
,
255 'title' => ts('Is Active') ,
256 'description' => 'Is this navigation item active?',
257 'table_name' => 'civicrm_navigation',
258 'entity' => 'Navigation',
259 'bao' => 'CRM_Core_BAO_Navigation',
262 'has_separator' => array(
263 'name' => 'has_separator',
264 'type' => CRM_Utils_Type
::T_BOOLEAN
,
265 'title' => ts('Use separator') ,
266 'description' => 'If separator needs to be added after this menu item',
267 'table_name' => 'civicrm_navigation',
268 'entity' => 'Navigation',
269 'bao' => 'CRM_Core_BAO_Navigation',
274 'type' => CRM_Utils_Type
::T_INT
,
275 'title' => ts('Order') ,
276 'description' => 'Ordering of the navigation items in various blocks.',
277 'table_name' => 'civicrm_navigation',
278 'entity' => 'Navigation',
279 'bao' => 'CRM_Core_BAO_Navigation',
283 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
285 return Civi
::$statics[__CLASS__
]['fields'];
288 * Return a mapping from field-name to the corresponding key (as used in fields()).
291 * Array(string $name => string $uniqueName).
293 static function &fieldKeys() {
294 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
295 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
297 return Civi
::$statics[__CLASS__
]['fieldKeys'];
300 * Returns the names of this table
304 static function getTableName() {
305 return self
::$_tableName;
308 * Returns if this table needs to be logged
316 * Returns the list of fields that can be imported
318 * @param bool $prefix
322 static function &import($prefix = false) {
323 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'navigation', $prefix, array());
327 * Returns the list of fields that can be exported
329 * @param bool $prefix
333 static function &export($prefix = false) {
334 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'navigation', $prefix, array());