bsUserPlugin

bsUser class

Enhancements from sfUser:

Filter attribute holder

bsUser class has ability to store values for filters is user’s session attribute holder.

Available methods:

bsUser.getFilter($filter_name, $default = array()) → values stored for filter name
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 }
bsUser.getFilterOptions($filter_name) → options stored in sfConfig for filter name
bsUser.setFilter($filter_name, $value)

set data for filter name

bsUser.getAllFilters() → all filters for current user
bsUser.resetFilter($filter_name)
bsUser.hasFilter($filter_name) → Boolean

Is filter used and with non-empty values?

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.

Table Of Contents

Previous topic

bsTypePlugin

Next topic

bsWebResourcesPlugin

This Page