public function addMainMenuItem($owner, $code, array $definition)
    {
        $itemKey = $this->makeItemKey($owner, $code);

        if (isset($this->items[$itemKey])) {
            $definition = array_merge((array) $this->items[$itemKey], $definition);
        }

        $item = (object) array_merge(self::$mainItemDefaults, array_merge($definition, [
            'code'  => $code,
            'owner' => $owner
        ]));

        $this->items[$itemKey] = $item;

        if ($item->sideMenu) {
            $this->addSideMenuItems($owner, $code, $item->sideMenu);
        }
    }
public function addMainMenuItem($owner, $code, array $definition)
    {
        $itemKey = $this->makeItemKey($owner, $code);

        if (isset($this->items[$itemKey])) {
            $definition = array_merge((array) $this->items[$itemKey], $definition);
        }

        $item = (object) array_merge(self::$mainItemDefaults, array_merge($definition, [
            'code'  => $code,
            'owner' => $owner
        ]));

        $this->items[$itemKey] = $item;

        if ($item->sideMenu) {
            $this->addSideMenuItems($owner, $code, $item->sideMenu);
        }
    }
public function addMainMenuItem ( $ owner , $ code , array $ definition ) { $ itemKey = $ this -> makeItemKey ( $ owner , $ code ) ; if ( isset ( $ this -> items [ $ itemKey ] ) ) { $ definition = array_merge ( ( array ) $ this -> items [ $ itemKey ] , $ definition ) ; } $ item = ( object ) array_merge ( self :: $ mainItemDefaults , array_merge ( $ definition , [ 'code' => $ code , 'owner' => $ owner ] ) ) ; $ this -> items [ $ itemKey ] = $ item ; if ( $ item -> sideMenu ) { $ this -> addSideMenuItems ( $ owner , $ code , $ item -> sideMenu ) ; } }
Dynamically add a single main menu item
@param string $owner
@param string $code
@param array  $definitions
Dynamically add a single main menu item