store\components\behaviors\DCategoryBehavior::getMenuList PHP Method

getMenuList() public method

Returns items for zii.widgets.CMenu widget
public getMenuList ( ) : array
return array
    public function getMenuList()
    {
        $criteria = $this->getOwnerCriteria();
        $items = $this->cached($this->getOwner())->findAll($criteria);
        $result = [];
        foreach ($items as $item) {
            $active = $item->{$this->linkActiveAttribute};
            $result[$item->getPrimaryKey()] = ['id' => $item->getPrimaryKey(), 'label' => $item->{$this->titleAttribute}, 'url' => $item->{$this->urlAttribute}, 'icon' => $this->iconAttribute !== null ? $item->{$this->iconAttribute} : '', 'active' => $active, 'itemOptions' => ['class' => 'item_' . $item->getPrimaryKey()], 'linkOptions' => $active ? ['rel' => 'nofollow'] : []];
        }
        return $result;
    }