configurationManager = $configurationManager; $this->menuConfiguration = $this->configurationManager->getConfiguration('Menu'); } /** * @var array */ protected $menuConfiguration; /** * @var array */ protected $items = array(); /** * @param string $forMenu * @return array */ public function getItems($forMenu = null) { if ($forMenu) { $items = &$this->menuConfiguration[$forMenu]; } else { $items = &$this->menuConfiguration; } if ($items) { uasort( $items, function ($a, $b) { return $a['sorting'] > $b['sorting']; } ); } return $items; } }