5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Core/Navigation.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:53624a8994290c1d2ae8f4158c89d3b2)
13 * Database access object for the Navigation entity.
15 class CRM_Core_DAO_Navigation
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_navigation';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
37 * Which Domain is this navigation item for
58 * url in case of custom navigation link
65 * CSS class name for an icon
72 * Permission for menu item
83 public $permission_operator;
86 * Parent navigation item, used for grouping
93 * Is this navigation item active?
100 * If separator needs to be added after this menu item
104 public $has_separator;
107 * Ordering of the navigation items in various blocks.
116 public function __construct() {
117 $this->__table
= 'civicrm_navigation';
118 parent
::__construct();
122 * Returns foreign keys and entity references.
125 * [CRM_Core_Reference_Interface]
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']);
134 return Civi
::$statics[__CLASS__
]['links'];
138 * Returns all the column names of this table
142 public static function &fields() {
143 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
144 Civi
::$statics[__CLASS__
]['fields'] = [
147 'type' => CRM_Utils_Type
::T_INT
,
148 'title' => ts('Navigation ID'),
150 'table_name' => 'civicrm_navigation',
151 'entity' => 'Navigation',
152 'bao' => 'CRM_Core_BAO_Navigation',
156 'name' => 'domain_id',
157 'type' => CRM_Utils_Type
::T_INT
,
158 'title' => ts('Navigation Domain'),
159 'description' => 'Which Domain is this navigation item for',
161 'table_name' => 'civicrm_navigation',
162 'entity' => 'Navigation',
163 'bao' => 'CRM_Core_BAO_Navigation',
165 'FKClassName' => 'CRM_Core_DAO_Domain',
166 'pseudoconstant' => [
167 'table' => 'civicrm_domain',
169 'labelColumn' => 'name',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Navigation Item Label'),
176 'description' => 'Navigation Title',
178 'size' => CRM_Utils_Type
::HUGE
,
179 'table_name' => 'civicrm_navigation',
180 'entity' => 'Navigation',
181 'bao' => 'CRM_Core_BAO_Navigation',
186 'type' => CRM_Utils_Type
::T_STRING
,
187 'title' => ts('Navigation Item Machine Name'),
188 'description' => 'Internal Name',
190 'size' => CRM_Utils_Type
::HUGE
,
191 'table_name' => 'civicrm_navigation',
192 'entity' => 'Navigation',
193 'bao' => 'CRM_Core_BAO_Navigation',
198 'type' => CRM_Utils_Type
::T_STRING
,
199 'title' => ts('Url'),
200 'description' => 'url in case of custom navigation link',
202 'size' => CRM_Utils_Type
::HUGE
,
203 'table_name' => 'civicrm_navigation',
204 'entity' => 'Navigation',
205 'bao' => 'CRM_Core_BAO_Navigation',
210 'type' => CRM_Utils_Type
::T_STRING
,
211 'title' => ts('Icon'),
212 'description' => 'CSS class name for an icon',
215 'size' => CRM_Utils_Type
::HUGE
,
217 'table_name' => 'civicrm_navigation',
218 'entity' => 'Navigation',
219 'bao' => 'CRM_Core_BAO_Navigation',
223 'name' => 'permission',
224 'type' => CRM_Utils_Type
::T_STRING
,
225 'title' => ts('Required Permission'),
226 'description' => 'Permission for menu item',
228 'size' => CRM_Utils_Type
::HUGE
,
229 'table_name' => 'civicrm_navigation',
230 'entity' => 'Navigation',
231 'bao' => 'CRM_Core_BAO_Navigation',
234 'permission_operator' => [
235 'name' => 'permission_operator',
236 'type' => CRM_Utils_Type
::T_STRING
,
237 'title' => ts('Permission Operator'),
238 'description' => 'Permission Operator',
240 'size' => CRM_Utils_Type
::FOUR
,
241 'table_name' => 'civicrm_navigation',
242 'entity' => 'Navigation',
243 'bao' => 'CRM_Core_BAO_Navigation',
247 'name' => 'parent_id',
248 'type' => CRM_Utils_Type
::T_INT
,
249 'title' => ts('Navigation parent ID'),
250 'description' => 'Parent navigation item, used for grouping',
251 'table_name' => 'civicrm_navigation',
252 'entity' => 'Navigation',
253 'bao' => 'CRM_Core_BAO_Navigation',
255 'FKClassName' => 'CRM_Core_DAO_Navigation',
256 'pseudoconstant' => [
257 'table' => 'civicrm_navigation',
259 'labelColumn' => 'label',
260 'nameColumn' => 'name',
264 'name' => 'is_active',
265 'type' => CRM_Utils_Type
::T_BOOLEAN
,
266 'title' => ts('Is Active'),
267 'description' => 'Is this navigation item active?',
268 'table_name' => 'civicrm_navigation',
269 'entity' => 'Navigation',
270 'bao' => 'CRM_Core_BAO_Navigation',
274 'name' => 'has_separator',
275 'type' => CRM_Utils_Type
::T_BOOLEAN
,
276 'title' => ts('Use separator'),
277 'description' => 'If separator needs to be added after this menu item',
278 'table_name' => 'civicrm_navigation',
279 'entity' => 'Navigation',
280 'bao' => 'CRM_Core_BAO_Navigation',
285 'type' => CRM_Utils_Type
::T_INT
,
286 'title' => ts('Order'),
287 'description' => 'Ordering of the navigation items in various blocks.',
288 'table_name' => 'civicrm_navigation',
289 'entity' => 'Navigation',
290 'bao' => 'CRM_Core_BAO_Navigation',
294 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
296 return Civi
::$statics[__CLASS__
]['fields'];
300 * Return a mapping from field-name to the corresponding key (as used in fields()).
303 * Array(string $name => string $uniqueName).
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()));
309 return Civi
::$statics[__CLASS__
]['fieldKeys'];
313 * Returns the names of this table
317 public static function getTableName() {
318 return self
::$_tableName;
322 * Returns if this table needs to be logged
326 public function getLog() {
331 * Returns the list of fields that can be imported
333 * @param bool $prefix
337 public static function &import($prefix = FALSE) {
338 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'navigation', $prefix, []);
343 * Returns the list of fields that can be exported
345 * @param bool $prefix
349 public static function &export($prefix = FALSE) {
350 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'navigation', $prefix, []);
355 * Returns the list of indices
357 * @param bool $localize
361 public static function indices($localize = TRUE) {
363 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;