Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
Navigation Class Reference

Public Member Functions

 __construct (ServiceLocatorInterface $serviceLocator, DeploymentConfig $deploymentConfig)
 
 getType ()
 
 getData ()
 
 getMenuItems ()
 
 getMainItems ()
 
 getTitles ()
 

Data Fields

const NAV_INSTALLER = 'navInstaller'
 
const NAV_UPDATER = 'navUpdater'
 

Detailed Description

Definition at line 12 of file Navigation.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ServiceLocatorInterface  $serviceLocator,
DeploymentConfig  $deploymentConfig 
)
Parameters
ServiceLocatorInterface$serviceLocator
DeploymentConfig$deploymentConfig

Definition at line 38 of file Navigation.php.

39  {
40  if ($deploymentConfig->isAvailable()) {
41  $this->navStates = $serviceLocator->get('config')[self::NAV_UPDATER];
42  $this->navType = self::NAV_UPDATER;
43  $this->titles = $serviceLocator->get('config')[self::NAV_UPDATER . 'Titles'];
44  } else {
45  $this->navStates = $serviceLocator->get('config')[self::NAV_INSTALLER];
46  $this->navType = self::NAV_INSTALLER;
47  $this->titles = $serviceLocator->get('config')[self::NAV_INSTALLER . 'Titles'];
48  }
49  }
$deploymentConfig

Member Function Documentation

◆ getData()

getData ( )
Returns
array

Definition at line 62 of file Navigation.php.

63  {
64  return $this->navStates;
65  }

◆ getMainItems()

getMainItems ( )

Retrieve array of menu items

Returns only items with 'main' equal to TRUE

Returns
array

Definition at line 91 of file Navigation.php.

92  {
93  $result = array_values(array_filter(
94  $this->navStates,
95  function ($value) {
96  return isset($value['main']) && (bool)$value['main'];
97  }
98  ));
99  return $result;
100  }
$value
Definition: gender.phtml:16

◆ getMenuItems()

getMenuItems ( )

Retrieve array of menu items

Returns only items with 'nav' equal to TRUE

Returns
array

Definition at line 74 of file Navigation.php.

75  {
76  return array_values(array_filter(
77  $this->navStates,
78  function ($value) {
79  return isset($value['nav']) && (bool)$value['nav'];
80  }
81  ));
82  }
$value
Definition: gender.phtml:16

◆ getTitles()

getTitles ( )

Returns titles of the navigation pages

Returns
array

Definition at line 107 of file Navigation.php.

108  {
109  return $this->titles;
110  }

◆ getType()

getType ( )
Returns
string

Definition at line 54 of file Navigation.php.

55  {
56  return $this->navType;
57  }

Field Documentation

◆ NAV_INSTALLER

const NAV_INSTALLER = 'navInstaller'

#+ Types of wizards

Definition at line 17 of file Navigation.php.

◆ NAV_UPDATER

const NAV_UPDATER = 'navUpdater'

Definition at line 18 of file Navigation.php.


The documentation for this class was generated from the following file: