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:3819d9a3e40bfbc36a06809c1f4bd98c)
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 localized title of this entity.
124 public static function getEntityTitle() {
125 return ts('Navigations');
129 * Returns foreign keys and entity references.
132 * [CRM_Core_Reference_Interface]
134 public static function getReferenceColumns() {
135 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
136 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
137 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
138 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'parent_id', 'civicrm_navigation', 'id');
139 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
141 return Civi
::$statics[__CLASS__
]['links'];
145 * Returns all the column names of this table
149 public static function &fields() {
150 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
151 Civi
::$statics[__CLASS__
]['fields'] = [
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Navigation ID'),
157 'where' => 'civicrm_navigation.id',
158 'table_name' => 'civicrm_navigation',
159 'entity' => 'Navigation',
160 'bao' => 'CRM_Core_BAO_Navigation',
164 'name' => 'domain_id',
165 'type' => CRM_Utils_Type
::T_INT
,
166 'title' => ts('Navigation Domain'),
167 'description' => ts('Which Domain is this navigation item for'),
169 'where' => 'civicrm_navigation.domain_id',
170 'table_name' => 'civicrm_navigation',
171 'entity' => 'Navigation',
172 'bao' => 'CRM_Core_BAO_Navigation',
174 'FKClassName' => 'CRM_Core_DAO_Domain',
175 'pseudoconstant' => [
176 'table' => 'civicrm_domain',
178 'labelColumn' => 'name',
183 'type' => CRM_Utils_Type
::T_STRING
,
184 'title' => ts('Navigation Item Label'),
185 'description' => ts('Navigation Title'),
187 'size' => CRM_Utils_Type
::HUGE
,
188 'where' => 'civicrm_navigation.label',
189 'table_name' => 'civicrm_navigation',
190 'entity' => 'Navigation',
191 'bao' => 'CRM_Core_BAO_Navigation',
196 'type' => CRM_Utils_Type
::T_STRING
,
197 'title' => ts('Navigation Item Machine Name'),
198 'description' => ts('Internal Name'),
200 'size' => CRM_Utils_Type
::HUGE
,
201 'where' => 'civicrm_navigation.name',
202 'table_name' => 'civicrm_navigation',
203 'entity' => 'Navigation',
204 'bao' => 'CRM_Core_BAO_Navigation',
209 'type' => CRM_Utils_Type
::T_STRING
,
210 'title' => ts('Url'),
211 'description' => ts('url in case of custom navigation link'),
213 'size' => CRM_Utils_Type
::HUGE
,
214 'where' => 'civicrm_navigation.url',
215 'table_name' => 'civicrm_navigation',
216 'entity' => 'Navigation',
217 'bao' => 'CRM_Core_BAO_Navigation',
222 'type' => CRM_Utils_Type
::T_STRING
,
223 'title' => ts('Icon'),
224 'description' => ts('CSS class name for an icon'),
227 'size' => CRM_Utils_Type
::HUGE
,
228 'where' => 'civicrm_navigation.icon',
230 'table_name' => 'civicrm_navigation',
231 'entity' => 'Navigation',
232 'bao' => 'CRM_Core_BAO_Navigation',
236 'name' => 'permission',
237 'type' => CRM_Utils_Type
::T_STRING
,
238 'title' => ts('Required Permission'),
239 'description' => ts('Permission for menu item'),
241 'size' => CRM_Utils_Type
::HUGE
,
242 'where' => 'civicrm_navigation.permission',
243 'table_name' => 'civicrm_navigation',
244 'entity' => 'Navigation',
245 'bao' => 'CRM_Core_BAO_Navigation',
248 'permission_operator' => [
249 'name' => 'permission_operator',
250 'type' => CRM_Utils_Type
::T_STRING
,
251 'title' => ts('Permission Operator'),
252 'description' => ts('Permission Operator'),
254 'size' => CRM_Utils_Type
::FOUR
,
255 'where' => 'civicrm_navigation.permission_operator',
256 'table_name' => 'civicrm_navigation',
257 'entity' => 'Navigation',
258 'bao' => 'CRM_Core_BAO_Navigation',
262 'name' => 'parent_id',
263 'type' => CRM_Utils_Type
::T_INT
,
264 'title' => ts('Navigation parent ID'),
265 'description' => ts('Parent navigation item, used for grouping'),
266 'where' => 'civicrm_navigation.parent_id',
267 'table_name' => 'civicrm_navigation',
268 'entity' => 'Navigation',
269 'bao' => 'CRM_Core_BAO_Navigation',
271 'FKClassName' => 'CRM_Core_DAO_Navigation',
272 'pseudoconstant' => [
273 'table' => 'civicrm_navigation',
275 'labelColumn' => 'label',
276 'nameColumn' => 'name',
280 'name' => 'is_active',
281 'type' => CRM_Utils_Type
::T_BOOLEAN
,
282 'title' => ts('Is Active'),
283 'description' => ts('Is this navigation item active?'),
284 'where' => 'civicrm_navigation.is_active',
285 'table_name' => 'civicrm_navigation',
286 'entity' => 'Navigation',
287 'bao' => 'CRM_Core_BAO_Navigation',
291 'name' => 'has_separator',
292 'type' => CRM_Utils_Type
::T_BOOLEAN
,
293 'title' => ts('Use separator'),
294 'description' => ts('If separator needs to be added after this menu item'),
295 'where' => 'civicrm_navigation.has_separator',
296 'table_name' => 'civicrm_navigation',
297 'entity' => 'Navigation',
298 'bao' => 'CRM_Core_BAO_Navigation',
303 'type' => CRM_Utils_Type
::T_INT
,
304 'title' => ts('Order'),
305 'description' => ts('Ordering of the navigation items in various blocks.'),
306 'where' => 'civicrm_navigation.weight',
307 'table_name' => 'civicrm_navigation',
308 'entity' => 'Navigation',
309 'bao' => 'CRM_Core_BAO_Navigation',
313 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
315 return Civi
::$statics[__CLASS__
]['fields'];
319 * Return a mapping from field-name to the corresponding key (as used in fields()).
322 * Array(string $name => string $uniqueName).
324 public static function &fieldKeys() {
325 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
326 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
328 return Civi
::$statics[__CLASS__
]['fieldKeys'];
332 * Returns the names of this table
336 public static function getTableName() {
337 return self
::$_tableName;
341 * Returns if this table needs to be logged
345 public function getLog() {
350 * Returns the list of fields that can be imported
352 * @param bool $prefix
356 public static function &import($prefix = FALSE) {
357 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'navigation', $prefix, []);
362 * Returns the list of fields that can be exported
364 * @param bool $prefix
368 public static function &export($prefix = FALSE) {
369 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'navigation', $prefix, []);
374 * Returns the list of indices
376 * @param bool $localize
380 public static function indices($localize = TRUE) {
382 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;