Sunnysideup\Ecommerce\ProductsAndGroups\Settings\UserPreference
keeps track of the settings for FILTER / SORT / DISPLAY for user the associated links and all that sort of stuff.
Synopsis
class UserPreference
{
- // constants
- const GET_VAR_VALUE_PLACE_HOLDER = '[[INSERT_VALUE_HERE]]';
- // members
- protected bool $secondaryTitleHasBeenAdded = false;
- protected array $useSession = ;
- protected array $useSessionPerPage = ;
- protected HTTPRequest $request;
- protected ContentController $rootGroupController;
- protected $rootGroup;
- protected array $userPreferences = ;
- protected static array $linkTemplateCache = ;
- private static array $use_session_per_page = ;
- private static array $use_session = ;
- private static array $secondary_title_fields = ;
- // methods
- public void setUseSession()
- public void getUseSession()
- public void getUseSessionAll()
- public void setUseSessionPerPage()
- public void getUseSessionPerPage()
- public void getUseSessionPerPageAll()
- public void setRequest()
- public void setRootGroupController()
- public void setRootGroup()
- public void saveUserPreferences()
- public string getCurrentUserPreferences()
- public void getSearchFilterTitle()
- public void getGroupFilterTitle()
- public void getFilterTitle()
- public void getSortTitle()
- public void getDisplayTitle()
- public void ProductGroupListCachingKey()
- public void addSecondaryTitle()
- public void standardiseCurrentUserPreferences()
- public void getOptions()
- public void getActions()
- public void getLinksPerType()
- public void getLinkTemplate()
- public mixed setIdArrayDefaultSort()
- public void IsShowFullList()
- public void getCurrentUserPreferencesKey()
- public void getCurrentUserPreferencesParams()
- public void getCurrentUserPreferencesTitle()
- public void getTitle()
- protected void savePreferenceToSession()
- protected void getSession()
- protected void getFinalProductList()
- protected void getBaseProductList()
- protected string addToTitle()
- protected void addTitleToField()
- protected ProductGroupSchema getProductGroupSchema()
- protected void matchingSegment()
- protected void mySegment()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
- SilverStripe\Core\Injector\Injectable
- Sunnysideup\Vardump\DebugTrait
Tasks
Line | Task |
---|---|
369 | add to config |
Constants
Name | Value |
---|---|
GET_VAR_VALUE_PLACE_HOLDER | '[[INSERT_VALUE_HERE]]' |
Members
private
- $secondary_title_fields
—
array
list of fields that we add the secondary title to... - $use_session
—
array
keep a store for every FILTER|SORT|DISPLAY setting? - $use_session_per_page
—
array
keep a store for every page setting? For example, do we store in session how a particular page is filtered / sorted.
protected
- $linkTemplateCache
- $request — SilverStripe\Control\HTTPRequest
- $rootGroup
- $rootGroupController — SilverStripe\CMS\Controllers\ContentController
- $secondaryTitleHasBeenAdded
—
Sunnysideup\Ecommerce\ProductsAndGroups\Settings\bool
variable to make sure secondary title only gets added once. - $useSession — array
- $useSessionPerPage — array
- $userPreferences
—
array
here is where we save the GET variables and any other settings for FILTER|SORT|DISPLAY.
Methods
protected
- addTitleToField()
- addToTitle() — removes any spaces from the 'toAdd' bit and adds the pipe if there is anything to add at all. Through the lang files, you can change the pipe symbol to anything you like.
- getBaseProductList()
- getFinalProductList()
- getProductGroupSchema()
- getSession()
- matchingSegment()
- mySegment()
- savePreferenceToSession()
public
- IsShowFullList() — special case of full list.
- ProductGroupListCachingKey() — Unique caching key for the product list...
- addSecondaryTitle() — Add a secondary title to the main title in case there is, for example, a filter applied (e.g. Socks | MyBrand).
- getActions()
- getCurrentUserPreferences() — Checks for the most applicable user preferences for this user: 1. session value 2. getListConfigCalculated.
- getCurrentUserPreferencesKey()
- getCurrentUserPreferencesParams()
- getCurrentUserPreferencesTitle()
- getDisplayTitle()
- getFilterTitle()
- getGroupFilterTitle()
- getLinkTemplate() — returns the current page with get variables. If a type is specified then instead of the value for that type, we add: '[[INSERT_HERE]]'.
- getLinksPerType() — full list of options with Links that know about "current".
- getOptions()
- getSearchFilterTitle()
- getSortTitle()
- getTitle()
- getUseSession()
- getUseSessionAll()
- getUseSessionPerPage()
- getUseSessionPerPageAll()
- saveUserPreferences() — Checks out a bunch of $_GET variables that are used to work out user preferences.
- setIdArrayDefaultSort() — TODO: move this to a better place!
- setRequest()
- setRootGroup()
- setRootGroupController()
- setUseSession()
- setUseSessionPerPage()
- standardiseCurrentUserPreferences()