3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Core/Navigation.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:28492fb431c3874453b53d0af4e3834a)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_Navigation
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_navigation';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
57 * Which Domain is this navigation item for
75 * url in case of custom navigation link
81 * Permission for menu item
91 public $permission_operator;
93 * Parent navigation item, used for grouping
99 * Is this navigation item active?
105 * If separator needs to be added after this menu item
109 public $has_separator;
111 * Ordering of the navigation items in various blocks.
119 * @return civicrm_navigation
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') ,
154 'domain_id' => array(
155 'name' => 'domain_id',
156 'type' => CRM_Utils_Type
::T_INT
,
157 'title' => ts('Navigation Domain') ,
158 'description' => 'Which Domain is this navigation item for',
160 'FKClassName' => 'CRM_Core_DAO_Domain',
161 'pseudoconstant' => array(
162 'table' => 'civicrm_domain',
164 'labelColumn' => 'name',
169 'type' => CRM_Utils_Type
::T_STRING
,
170 'title' => ts('Navigation Item Label') ,
171 'description' => 'Navigation Title',
173 'size' => CRM_Utils_Type
::HUGE
,
177 'type' => CRM_Utils_Type
::T_STRING
,
178 'title' => ts('Navigation Item Machine Name') ,
179 'description' => 'Internal Name',
181 'size' => CRM_Utils_Type
::HUGE
,
185 'type' => CRM_Utils_Type
::T_STRING
,
186 'title' => ts('Url') ,
187 'description' => 'url in case of custom navigation link',
189 'size' => CRM_Utils_Type
::HUGE
,
191 'permission' => array(
192 'name' => 'permission',
193 'type' => CRM_Utils_Type
::T_STRING
,
194 'title' => ts('Required Permission') ,
195 'description' => 'Permission for menu item',
197 'size' => CRM_Utils_Type
::HUGE
,
199 'permission_operator' => array(
200 'name' => 'permission_operator',
201 'type' => CRM_Utils_Type
::T_STRING
,
202 'title' => ts('Permission Operator') ,
203 'description' => 'Permission Operator',
205 'size' => CRM_Utils_Type
::FOUR
,
207 'parent_id' => array(
208 'name' => 'parent_id',
209 'type' => CRM_Utils_Type
::T_INT
,
210 'title' => ts('Navigation parent ID') ,
211 'description' => 'Parent navigation item, used for grouping',
212 'FKClassName' => 'CRM_Core_DAO_Navigation',
213 'pseudoconstant' => array(
214 'table' => 'civicrm_navigation',
215 'keyColumn' => 'name',
216 'labelColumn' => 'label',
219 'is_active' => array(
220 'name' => 'is_active',
221 'type' => CRM_Utils_Type
::T_BOOLEAN
,
222 'title' => ts('Is Active') ,
223 'description' => 'Is this navigation item active?',
225 'has_separator' => array(
226 'name' => 'has_separator',
227 'type' => CRM_Utils_Type
::T_BOOLEAN
,
228 'title' => ts('Use separator') ,
229 'description' => 'If separator needs to be added after this menu item',
233 'type' => CRM_Utils_Type
::T_INT
,
234 'title' => ts('Order') ,
235 'description' => 'Ordering of the navigation items in various blocks.',
238 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
240 return Civi
::$statics[__CLASS__
]['fields'];
243 * Return a mapping from field-name to the corresponding key (as used in fields()).
246 * Array(string $name => string $uniqueName).
248 static function &fieldKeys() {
249 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
250 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
252 return Civi
::$statics[__CLASS__
]['fieldKeys'];
255 * Returns the names of this table
259 static function getTableName() {
260 return self
::$_tableName;
263 * Returns if this table needs to be logged
271 * Returns the list of fields that can be imported
273 * @param bool $prefix
277 static function &import($prefix = false) {
278 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'navigation', $prefix, array());
282 * Returns the list of fields that can be exported
284 * @param bool $prefix
288 static function &export($prefix = false) {
289 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'navigation', $prefix, array());