src/ShopBundle/objects/ArticleList/Module.php
protected function renderProducts($viewName, ResultDataInterface $results = null, StateInterface $enrichedState = null)
    {
        // need to cache this
        $cacheKey = null;
        if ($this->_AllowCache()) {
            $cacheKeyData = $this->_GetCacheParameters();
            $cacheKeyData['is_article_list_content'] = true;
            $cacheKey = $this->cache->getKey($cacheKeyData);
            $resultHTML = $this->cache->get($cacheKey);
            if (null !== $resultHTML) {
                return $resultHTML;
            }
        }

        if (null === $enrichedState) {
            $enrichedState = $this->enrichStateWithDefaultsFromConfiguration();
        }

        if (null === $results) {
            $results = $this->getResults($enrichedState);
        }

        $items = $results->asArray();

        $inputData = array(
            'activePageNumber' => $results->getPage(),
            'itemMapperBaseData' => $this->getItemMapperBaseData(),
            'items' => $items,
            'results' => $results,
            'listPagerUrl' => $this->getListPageUrl(),
            'listPageSizeChangeUrl' => $this->getListPageSizeUrl(),
            'numberOfPages' => $results->getNumberOfPages(),
            'state' => $enrichedState->getStateArrayWithoutQueryParameter(),
            'stateObject' => $enrichedState,
            'sortList' => $this->getSortList(),
            'sortFieldName' => $this->getSortFieldName(),
            'sortFormAction' => $this->getSortFormAction(),
            'sortFormStateInputFields' => $this->getSortFormStateInputFields(),
            'activeSortId' => $this->getActiveSortId(),
            'listConfiguration' => $this->getConfiguration(),
            'sModuleSpotName' => $this->sModuleSpotName,
            'local' => $this->getActiveLocal(),
            'currency' => $this->getActiveCurrency(),
            'shop' => $this->getActiveShop(),
        );

        $inputData = array_merge($inputData, $this->getListInformationFromConfiguration());

        $resultHTML = $this->render($viewName, $inputData);
        if ($this->_AllowCache()) {
            $cacheTrigger = new \MapperCacheTrigger();
            $cacheTriggerRestricted = new \MapperCacheTriggerRestrictedProxy($cacheTrigger);
            $this->configureCacheTrigger($cacheTriggerRestricted);
            $trigger = $cacheTrigger->getTrigger();
            $this->cache->set($cacheKey, $resultHTML, $trigger);
        }

        return $resultHTML;
    }
protected function renderProducts($viewName, ResultDataInterface $results = null, StateInterface $enrichedState = null)
    {
        // need to cache this
        $cacheKey = null;
        if ($this->_AllowCache()) {
            $cacheKeyData = $this->_GetCacheParameters();
            $cacheKeyData['is_article_list_content'] = true;
            $cacheKey = $this->cache->getKey($cacheKeyData);
            $resultHTML = $this->cache->get($cacheKey);
            if (null !== $resultHTML) {
                return $resultHTML;
            }
        }

        if (null === $enrichedState) {
            $enrichedState = $this->enrichStateWithDefaultsFromConfiguration();
        }

        if (null === $results) {
            $results = $this->getResults($enrichedState);
        }

        $items = $results->asArray();

        $inputData = array(
            'activePageNumber' => $results->getPage(),
            'itemMapperBaseData' => $this->getItemMapperBaseData(),
            'items' => $items,
            'results' => $results,
            'listPagerUrl' => $this->getListPageUrl(),
            'listPageSizeChangeUrl' => $this->getListPageSizeUrl(),
            'numberOfPages' => $results->getNumberOfPages(),
            'state' => $enrichedState->getStateArrayWithoutQueryParameter(),
            'stateObject' => $enrichedState,
            'sortList' => $this->getSortList(),
            'sortFieldName' => $this->getSortFieldName(),
            'sortFormAction' => $this->getSortFormAction(),
            'sortFormStateInputFields' => $this->getSortFormStateInputFields(),
            'activeSortId' => $this->getActiveSortId(),
            'listConfiguration' => $this->getConfiguration(),
            'sModuleSpotName' => $this->sModuleSpotName,
            'local' => $this->getActiveLocal(),
            'currency' => $this->getActiveCurrency(),
            'shop' => $this->getActiveShop(),
        );

        $inputData = array_merge($inputData, $this->getListInformationFromConfiguration());

        $resultHTML = $this->render($viewName, $inputData);
        if ($this->_AllowCache()) {
            $cacheTrigger = new \MapperCacheTrigger();
            $cacheTriggerRestricted = new \MapperCacheTriggerRestrictedProxy($cacheTrigger);
            $this->configureCacheTrigger($cacheTriggerRestricted);
            $trigger = $cacheTrigger->getTrigger();
            $this->cache->set($cacheKey, $resultHTML, $trigger);
        }

        return $resultHTML;
    }
protected function renderProducts ( $ viewName , ResultDataInterface $ results = null , StateInterface $ enrichedState = null ) { // need to cache this $ cacheKey = null ; if ( $ this -> _AllowCache ( ) ) { $ cacheKeyData = $ this -> _GetCacheParameters ( ) ; $ cacheKeyData [ 'is_article_list_content' ] = true ; $ cacheKey = $ this -> cache -> getKey ( $ cacheKeyData ) ; $ resultHTML = $ this -> cache -> get ( $ cacheKey ) ; if ( null !== $ resultHTML ) { return $ resultHTML ; } } if ( null === $ enrichedState ) { $ enrichedState = $ this -> enrichStateWithDefaultsFromConfiguration ( ) ; } if ( null === $ results ) { $ results = $ this -> getResults ( $ enrichedState ) ; } $ items = $ results -> asArray ( ) ; $ inputData = array ( 'activePageNumber' => $ results -> getPage ( ) , 'itemMapperBaseData' => $ this -> getItemMapperBaseData ( ) , 'items' => $ items , 'results' => $ results , 'listPagerUrl' => $ this -> getListPageUrl ( ) , 'listPageSizeChangeUrl' => $ this -> getListPageSizeUrl ( ) , 'numberOfPages' => $ results -> getNumberOfPages ( ) , 'state' => $ enrichedState -> getStateArrayWithoutQueryParameter ( ) , 'stateObject' => $ enrichedState , 'sortList' => $ this -> getSortList ( ) , 'sortFieldName' => $ this -> getSortFieldName ( ) , 'sortFormAction' => $ this -> getSortFormAction ( ) , 'sortFormStateInputFields' => $ this -> getSortFormStateInputFields ( ) , 'activeSortId' => $ this -> getActiveSortId ( ) , 'listConfiguration' => $ this -> getConfiguration ( ) , 'sModuleSpotName' => $ this -> sModuleSpotName , 'local' => $ this -> getActiveLocal ( ) , 'currency' => $ this -> getActiveCurrency ( ) , 'shop' => $ this -> getActiveShop ( ) , ) ; $ inputData = array_merge ( $ inputData , $ this -> getListInformationFromConfiguration ( ) ) ; $ resultHTML = $ this -> render ( $ viewName , $ inputData ) ; if ( $ this -> _AllowCache ( ) ) { $ cacheTrigger = new \ MapperCacheTrigger ( ) ; $ cacheTriggerRestricted = new \ MapperCacheTriggerRestrictedProxy ( $ cacheTrigger ) ; $ this -> configureCacheTrigger ( $ cacheTriggerRestricted ) ; $ trigger = $ cacheTrigger -> getTrigger ( ) ; $ this -> cache -> set ( $ cacheKey , $ resultHTML , $ trigger ) ; } return $ resultHTML ; }
renders product list using the view provided. this should really be in another controller,
unfortunately Chameleon currently does not support calling other controllers the way symfony does.

@param string              $viewName
@param ResultDataInterface $results
@param StateInterface      $enrichedState

@return string
renders product list using the view provided . this should really be in another controller unfortunately Chameleon currently does not support calling other controllers the way symfony does .