5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Navigation.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:aeeb917df8c32ff97102c2c710d41d19)
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 public static $_tableName = 'civicrm_navigation';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
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 'where' => 'civicrm_navigation.id',
151 'table_name' => 'civicrm_navigation',
152 'entity' => 'Navigation',
153 'bao' => 'CRM_Core_BAO_Navigation',
157 'name' => 'domain_id',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('Navigation Domain'),
160 'description' => ts('Which Domain is this navigation item for'),
162 'where' => 'civicrm_navigation.domain_id',
163 'table_name' => 'civicrm_navigation',
164 'entity' => 'Navigation',
165 'bao' => 'CRM_Core_BAO_Navigation',
167 'FKClassName' => 'CRM_Core_DAO_Domain',
168 'pseudoconstant' => [
169 'table' => 'civicrm_domain',
171 'labelColumn' => 'name',
176 'type' => CRM_Utils_Type
::T_STRING
,
177 'title' => ts('Navigation Item Label'),
178 'description' => ts('Navigation Title'),
180 'size' => CRM_Utils_Type
::HUGE
,
181 'where' => 'civicrm_navigation.label',
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' => ts('Internal Name'),
193 'size' => CRM_Utils_Type
::HUGE
,
194 'where' => 'civicrm_navigation.name',
195 'table_name' => 'civicrm_navigation',
196 'entity' => 'Navigation',
197 'bao' => 'CRM_Core_BAO_Navigation',
202 'type' => CRM_Utils_Type
::T_STRING
,
203 'title' => ts('Url'),
204 'description' => ts('url in case of custom navigation link'),
206 'size' => CRM_Utils_Type
::HUGE
,
207 'where' => 'civicrm_navigation.url',
208 'table_name' => 'civicrm_navigation',
209 'entity' => 'Navigation',
210 'bao' => 'CRM_Core_BAO_Navigation',
215 'type' => CRM_Utils_Type
::T_STRING
,
216 'title' => ts('Icon'),
217 'description' => ts('CSS class name for an icon'),
220 'size' => CRM_Utils_Type
::HUGE
,
221 'where' => 'civicrm_navigation.icon',
223 'table_name' => 'civicrm_navigation',
224 'entity' => 'Navigation',
225 'bao' => 'CRM_Core_BAO_Navigation',
229 'name' => 'permission',
230 'type' => CRM_Utils_Type
::T_STRING
,
231 'title' => ts('Required Permission'),
232 'description' => ts('Permission for menu item'),
234 'size' => CRM_Utils_Type
::HUGE
,
235 'where' => 'civicrm_navigation.permission',
236 'table_name' => 'civicrm_navigation',
237 'entity' => 'Navigation',
238 'bao' => 'CRM_Core_BAO_Navigation',
241 'permission_operator' => [
242 'name' => 'permission_operator',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('Permission Operator'),
245 'description' => ts('Permission Operator'),
247 'size' => CRM_Utils_Type
::FOUR
,
248 'where' => 'civicrm_navigation.permission_operator',
249 'table_name' => 'civicrm_navigation',
250 'entity' => 'Navigation',
251 'bao' => 'CRM_Core_BAO_Navigation',
255 'name' => 'parent_id',
256 'type' => CRM_Utils_Type
::T_INT
,
257 'title' => ts('Navigation parent ID'),
258 'description' => ts('Parent navigation item, used for grouping'),
259 'where' => 'civicrm_navigation.parent_id',
260 'table_name' => 'civicrm_navigation',
261 'entity' => 'Navigation',
262 'bao' => 'CRM_Core_BAO_Navigation',
264 'FKClassName' => 'CRM_Core_DAO_Navigation',
265 'pseudoconstant' => [
266 'table' => 'civicrm_navigation',
268 'labelColumn' => 'label',
269 'nameColumn' => 'name',
273 'name' => 'is_active',
274 'type' => CRM_Utils_Type
::T_BOOLEAN
,
275 'title' => ts('Is Active'),
276 'description' => ts('Is this navigation item active?'),
277 'where' => 'civicrm_navigation.is_active',
278 'table_name' => 'civicrm_navigation',
279 'entity' => 'Navigation',
280 'bao' => 'CRM_Core_BAO_Navigation',
284 'name' => 'has_separator',
285 'type' => CRM_Utils_Type
::T_BOOLEAN
,
286 'title' => ts('Use separator'),
287 'description' => ts('If separator needs to be added after this menu item'),
288 'where' => 'civicrm_navigation.has_separator',
289 'table_name' => 'civicrm_navigation',
290 'entity' => 'Navigation',
291 'bao' => 'CRM_Core_BAO_Navigation',
296 'type' => CRM_Utils_Type
::T_INT
,
297 'title' => ts('Order'),
298 'description' => ts('Ordering of the navigation items in various blocks.'),
299 'where' => 'civicrm_navigation.weight',
300 'table_name' => 'civicrm_navigation',
301 'entity' => 'Navigation',
302 'bao' => 'CRM_Core_BAO_Navigation',
306 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
308 return Civi
::$statics[__CLASS__
]['fields'];
312 * Return a mapping from field-name to the corresponding key (as used in fields()).
315 * Array(string $name => string $uniqueName).
317 public static function &fieldKeys() {
318 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
319 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
321 return Civi
::$statics[__CLASS__
]['fieldKeys'];
325 * Returns the names of this table
329 public static function getTableName() {
330 return self
::$_tableName;
334 * Returns if this table needs to be logged
338 public function getLog() {
343 * Returns the list of fields that can be imported
345 * @param bool $prefix
349 public static function &import($prefix = FALSE) {
350 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'navigation', $prefix, []);
355 * Returns the list of fields that can be exported
357 * @param bool $prefix
361 public static function &export($prefix = FALSE) {
362 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'navigation', $prefix, []);
367 * Returns the list of indices
369 * @param bool $localize
373 public static function indices($localize = TRUE) {
375 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;