.. highlight:: yaml .. index:: pair: plugin; bsUserPlugin .. _bsUserPlugin: bsUserPlugin ********************************************* .. index:: triple: bsUser; bsUserPlugin; user bsUser class ============================================= Enhancements from sfUser: .. _filter_attribute_holder: Filter attribute holder --------------------------------------------- bsUser class has ability to store values for filters is user's session attribute holder. Available methods: .. method:: bsUser.getFilter($filter_name, $default = array())-> values stored for filter name .. method:: bsUser.getMappedFilter($filter_name, $mapping_name, $default = array()) returns values stored for filter name and maps them using `$mapping_name` stored in sfConfig, e.g.:: all: filter: dictionary_lemma: # filter name mapping: "pcDictionaryLemma/list": # mapping name # filter field name mapped key name fulltext: { to: fulltext } dictionary_language_id: { to: language } hamnosys: { to: hamnosys } signwriting: { to: signwriting } is_collocation: { to: is_collocation } dictionary_part_of_speech_id: { to: part_of_speech } dictionary_categorys_list: { to: category } dictionary_lessons_list: { to: lesson } dictionary_regions_list: { to: region } .. method:: bsUser.getFilterOptions($filter_name)-> options stored in sfConfig for filter name .. method:: bsUser.setFilter($filter_name, $value) set data for filter name .. method:: bsUser.getAllFilters()-> all filters for current user .. method:: bsUser.resetFilter($filter_name) .. method:: bsUser.hasFilter($filter_name)-> Boolean Is filter used and with non-empty values? .. method:: bsUser.updateFilterFromRequest($filter_name, sfWebRequest $request, $route_star_group_name) Maps parameters from url (star parameters) to the filter. It uses star parameters from group `$route_star_group_name`. If parameters from this group are present in the url then the values are copied to the filter values.