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:8cc5473f0cd98bf289dc455eefb0af76)
13 * Database access object for the Navigation entity.
15 class CRM_Core_DAO_Navigation
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.0';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_navigation';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
39 * Which Domain is this navigation item for
60 * url in case of custom navigation link
67 * CSS class name for an icon
74 * Permission for menu item
85 public $permission_operator;
88 * Parent navigation item, used for grouping
95 * Is this navigation item active?
102 * Place a separator either before or after this menu item.
106 public $has_separator;
109 * Ordering of the navigation items in various blocks.
118 public function __construct() {
119 $this->__table
= 'civicrm_navigation';
120 parent
::__construct();
124 * Returns localized title of this entity.
126 * @param bool $plural
127 * Whether to return the plural version of the title.
129 public static function getEntityTitle($plural = FALSE) {
130 return $plural ?
ts('Navigations') : ts('Navigation');
134 * Returns foreign keys and entity references.
137 * [CRM_Core_Reference_Interface]
139 public static function getReferenceColumns() {
140 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
141 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
142 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
143 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'parent_id', 'civicrm_navigation', 'id');
144 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
146 return Civi
::$statics[__CLASS__
]['links'];
150 * Returns all the column names of this table
154 public static function &fields() {
155 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
156 Civi
::$statics[__CLASS__
]['fields'] = [
159 'type' => CRM_Utils_Type
::T_INT
,
160 'title' => ts('Navigation ID'),
162 'where' => 'civicrm_navigation.id',
163 'table_name' => 'civicrm_navigation',
164 'entity' => 'Navigation',
165 'bao' => 'CRM_Core_BAO_Navigation',
170 'name' => 'domain_id',
171 'type' => CRM_Utils_Type
::T_INT
,
172 'title' => ts('Navigation Domain'),
173 'description' => ts('Which Domain is this navigation item for'),
175 'where' => 'civicrm_navigation.domain_id',
176 'table_name' => 'civicrm_navigation',
177 'entity' => 'Navigation',
178 'bao' => 'CRM_Core_BAO_Navigation',
180 'FKClassName' => 'CRM_Core_DAO_Domain',
181 'pseudoconstant' => [
182 'table' => 'civicrm_domain',
184 'labelColumn' => 'name',
190 'type' => CRM_Utils_Type
::T_STRING
,
191 'title' => ts('Navigation Item Label'),
192 'description' => ts('Navigation Title'),
194 'size' => CRM_Utils_Type
::HUGE
,
195 'where' => 'civicrm_navigation.label',
196 'table_name' => 'civicrm_navigation',
197 'entity' => 'Navigation',
198 'bao' => 'CRM_Core_BAO_Navigation',
204 'type' => CRM_Utils_Type
::T_STRING
,
205 'title' => ts('Navigation Item Machine Name'),
206 'description' => ts('Internal Name'),
208 'size' => CRM_Utils_Type
::HUGE
,
209 'where' => 'civicrm_navigation.name',
210 'table_name' => 'civicrm_navigation',
211 'entity' => 'Navigation',
212 'bao' => 'CRM_Core_BAO_Navigation',
218 'type' => CRM_Utils_Type
::T_STRING
,
219 'title' => ts('Url'),
220 'description' => ts('url in case of custom navigation link'),
222 'size' => CRM_Utils_Type
::HUGE
,
223 'where' => 'civicrm_navigation.url',
224 'table_name' => 'civicrm_navigation',
225 'entity' => 'Navigation',
226 'bao' => 'CRM_Core_BAO_Navigation',
232 'type' => CRM_Utils_Type
::T_STRING
,
233 'title' => ts('Icon'),
234 'description' => ts('CSS class name for an icon'),
237 'size' => CRM_Utils_Type
::HUGE
,
238 'where' => 'civicrm_navigation.icon',
240 'table_name' => 'civicrm_navigation',
241 'entity' => 'Navigation',
242 'bao' => 'CRM_Core_BAO_Navigation',
247 'name' => 'permission',
248 'type' => CRM_Utils_Type
::T_STRING
,
249 'title' => ts('Required Permission'),
250 'description' => ts('Permission for menu item'),
252 'size' => CRM_Utils_Type
::HUGE
,
253 'where' => 'civicrm_navigation.permission',
254 'table_name' => 'civicrm_navigation',
255 'entity' => 'Navigation',
256 'bao' => 'CRM_Core_BAO_Navigation',
260 'permission_operator' => [
261 'name' => 'permission_operator',
262 'type' => CRM_Utils_Type
::T_STRING
,
263 'title' => ts('Permission Operator'),
264 'description' => ts('Permission Operator'),
266 'size' => CRM_Utils_Type
::FOUR
,
267 'where' => 'civicrm_navigation.permission_operator',
268 'table_name' => 'civicrm_navigation',
269 'entity' => 'Navigation',
270 'bao' => 'CRM_Core_BAO_Navigation',
275 'name' => 'parent_id',
276 'type' => CRM_Utils_Type
::T_INT
,
277 'title' => ts('Navigation parent ID'),
278 'description' => ts('Parent navigation item, used for grouping'),
279 'where' => 'civicrm_navigation.parent_id',
280 'table_name' => 'civicrm_navigation',
281 'entity' => 'Navigation',
282 'bao' => 'CRM_Core_BAO_Navigation',
284 'FKClassName' => 'CRM_Core_DAO_Navigation',
285 'pseudoconstant' => [
286 'table' => 'civicrm_navigation',
288 'labelColumn' => 'label',
289 'nameColumn' => 'name',
294 'name' => 'is_active',
295 'type' => CRM_Utils_Type
::T_BOOLEAN
,
296 'title' => ts('Is Active'),
297 'description' => ts('Is this navigation item active?'),
298 'where' => 'civicrm_navigation.is_active',
299 'table_name' => 'civicrm_navigation',
300 'entity' => 'Navigation',
301 'bao' => 'CRM_Core_BAO_Navigation',
306 'name' => 'has_separator',
307 'type' => CRM_Utils_Type
::T_INT
,
308 'title' => ts('Separator'),
309 'description' => ts('Place a separator either before or after this menu item.'),
310 'where' => 'civicrm_navigation.has_separator',
312 'table_name' => 'civicrm_navigation',
313 'entity' => 'Navigation',
314 'bao' => 'CRM_Core_BAO_Navigation',
316 'pseudoconstant' => [
317 'callback' => 'CRM_Core_SelectValues::navigationMenuSeparator',
323 'type' => CRM_Utils_Type
::T_INT
,
324 'title' => ts('Order'),
325 'description' => ts('Ordering of the navigation items in various blocks.'),
326 'where' => 'civicrm_navigation.weight',
327 'table_name' => 'civicrm_navigation',
328 'entity' => 'Navigation',
329 'bao' => 'CRM_Core_BAO_Navigation',
334 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
336 return Civi
::$statics[__CLASS__
]['fields'];
340 * Return a mapping from field-name to the corresponding key (as used in fields()).
343 * Array(string $name => string $uniqueName).
345 public static function &fieldKeys() {
346 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
347 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
349 return Civi
::$statics[__CLASS__
]['fieldKeys'];
353 * Returns the names of this table
357 public static function getTableName() {
358 return self
::$_tableName;
362 * Returns if this table needs to be logged
366 public function getLog() {
371 * Returns the list of fields that can be imported
373 * @param bool $prefix
377 public static function &import($prefix = FALSE) {
378 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'navigation', $prefix, []);
383 * Returns the list of fields that can be exported
385 * @param bool $prefix
389 public static function &export($prefix = FALSE) {
390 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'navigation', $prefix, []);
395 * Returns the list of indices
397 * @param bool $localize
401 public static function indices($localize = TRUE) {
403 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;