protected function _setNavigationElementFromRecord(CmsCategoryRecord $record, \Mmi\Navigation\NavigationConfigElement $element)
    {
        $params = [];
        parse_str($record->mvcParams, $params);
        $params['uri'] = $record->customUri ? $record->customUri : $record->uri;
        $config = $record->getConfig();
        $config->typeId = $record->cmsCategoryTypeId;
        $config->categoryId = $record->id;
        $element
            ->setModule('cms')
            ->setController('category')
            ->setAction('dispatch')
            ->setParams($params)
            ->setBlank($record->blank ? true : false)
            ->setDisabled($record->active ? false : true)
            ->setHttps($record->https)
            ->setUri($record->redirectUri ? : null)
            ->setLabel($record->name)
            ->setLang($record->lang)
            ->setFollow($record->follow ? true : false)
            ->setConfig($config)
            ->setDateStart($record->dateStart)
            ->setDateEnd($record->dateEnd);
		if ($record->title) {
			$element->setTitle($record->title);
		}
		if ($record->description) {
			$element->setDescription($record->description);
		}
        return $this->_setNavigationElementRoles($record, $element);
    }
protected function _setNavigationElementFromRecord(CmsCategoryRecord $record, \Mmi\Navigation\NavigationConfigElement $element)
    {
        $params = [];
        parse_str($record->mvcParams, $params);
        $params['uri'] = $record->customUri ? $record->customUri : $record->uri;
        $config = $record->getConfig();
        $config->typeId = $record->cmsCategoryTypeId;
        $config->categoryId = $record->id;
        $element
            ->setModule('cms')
            ->setController('category')
            ->setAction('dispatch')
            ->setParams($params)
            ->setBlank($record->blank ? true : false)
            ->setDisabled($record->active ? false : true)
            ->setHttps($record->https)
            ->setUri($record->redirectUri ? : null)
            ->setLabel($record->name)
            ->setLang($record->lang)
            ->setFollow($record->follow ? true : false)
            ->setConfig($config)
            ->setDateStart($record->dateStart)
            ->setDateEnd($record->dateEnd);
		if ($record->title) {
			$element->setTitle($record->title);
		}
		if ($record->description) {
			$element->setDescription($record->description);
		}
        return $this->_setNavigationElementRoles($record, $element);
    }
protected function _setNavigationElementFromRecord ( CmsCategoryRecord $ record , \ Mmi \ Navigation \ NavigationConfigElement $ element ) { $ params = [ ] ; parse_str ( $ record -> mvcParams , $ params ) ; $ params [ 'uri' ] = $ record -> customUri ? $ record -> customUri : $ record -> uri ; $ config = $ record -> getConfig ( ) ; $ config -> typeId = $ record -> cmsCategoryTypeId ; $ config -> categoryId = $ record -> id ; $ element -> setModule ( 'cms' ) -> setController ( 'category' ) -> setAction ( 'dispatch' ) -> setParams ( $ params ) -> setBlank ( $ record -> blank ? true : false ) -> setDisabled ( $ record -> active ? false : true ) -> setHttps ( $ record -> https ) -> setUri ( $ record -> redirectUri ? : null ) -> setLabel ( $ record -> name ) -> setLang ( $ record -> lang ) -> setFollow ( $ record -> follow ? true : false ) -> setConfig ( $ config ) -> setDateStart ( $ record -> dateStart ) -> setDateEnd ( $ record -> dateEnd ) ; if ( $ record -> title ) { $ element -> setTitle ( $ record -> title ) ; } if ( $ record -> description ) { $ element -> setDescription ( $ record -> description ) ; } return $ this -> _setNavigationElementRoles ( $ record , $ element ) ; }
Ustawia dane elementu nawigacji na podstawie rekordu kategorii
@param \Cms\Orm\CmsCategoryRecord $record
@param \Mmi\Navigation\NavigationConfigElement $element
@return \Mmi\Navigation\NavigationConfigElement
Ustawia dane elementu nawigacji na podstawie rekordu kategorii