/** * returns the required ProductGroupHolder template name required by the * decorators owner in dependence on the active group view. * * @param string $templateBase Base name for the template to use. * * @return string */ public function getProductGroupHolderTemplateName($templateBase = 'SilvercartProductGroupHolder') { $groupHolderView = SilvercartGroupViewHandler::getActiveGroupHolderView(); if (!$this->owner->isGroupHolderViewAllowed($groupHolderView)) { $groupHolderView = $this->owner->getDefaultGroupHolderViewInherited(); } if (empty($groupHolderView)) { $groupHolderView = SilvercartGroupViewHandler::getDefaultGroupHolderView(); } return SilvercartGroupViewHandler::getProductGroupPageTemplateNameFor($groupHolderView, $templateBase); }
/** * Returns the cache key parts for this product group holder * * @return array * * @author Sebastian Diel <*****@*****.**> * @since 20.01.2014 */ public function CacheKeyParts() { if (is_null($this->cacheKeyParts)) { $lastEditedChildID = 0; if ($this->dataRecord->Children()->Count() > 0) { $this->dataRecord->Children()->sort('LastEdited', 'DESC'); $lastEditedChildID = $this->dataRecord->Children()->First()->ID; } $cacheKeyParts = array(i18n::get_locale(), $this->dataRecord->LastEdited, $this->getSqlOffsetForProductGroups(), SilvercartGroupViewHandler::getActiveGroupHolderView(), $lastEditedChildID); $this->extend('updateCacheKeyParts', $cacheKeyParts); $this->cacheKeyParts = $cacheKeyParts; } return $this->cacheKeyParts; }
/** * returns, wether the group view is active or not * * @return bool */ public function getActiveHolder() { if (is_null($this->activeHolder)) { $this->setActiveHolder($this->Code == SilvercartGroupViewHandler::getActiveGroupHolderView()); } return $this->activeHolder; }