src/lib/models/folio.ts
A specialized SzFolio class used for storing the user's search history.
Properties |
|
Methods |
|
Accessors |
constructor(items?: SzSearchHistoryFolioItem[])
|
||||||
Parameters :
|
Public _name |
Type : string
|
Default value : 'Search History'
|
hardcoded to 'Search History' |
items |
Type : SzSearchHistoryFolioItem[]
|
the collection of search parameters used in the last X searches |
Public maxItems |
Type : number
|
Default value : 20
|
The number of searches back to store in the folio |
Public updateMode |
Type : number
|
Default value : 1
|
update mode. when a user searches for something that is already in the search history should the item be moved to the top of the stack, updated in place, or ignored. possible values are -1(ignore), 0(replace), 1(update position) |
name |
Type : string
|
the name of the search set |
Public add | ||||||||||||
add(item: SzSearchHistoryFolioItem, overwrite: boolean)
|
||||||||||||
Add a new search parameter set to the stack
Parameters :
Returns :
Boolean
|
exists | ||||||
exists(item: SzSearchHistoryFolioItem)
|
||||||
whether or not the folio item passed in already exists in collection
Parameters :
Returns :
boolean
|
Public fromJSONObject | ||||||
fromJSONObject(data: literal type)
|
||||||
set the folios properties via a json model. This is the same model that this.toJSONObject returns
Parameters :
Returns :
void
|
indexOf | ||||||
indexOf(item: SzSearchHistoryFolioItem)
|
||||||
returns the index position of an existing folio item
Parameters :
Returns :
number
|
Public toJSONObject |
toJSONObject()
|
get a json representation model of this class and its items.
Returns :
literal type
|
Public trimItemsTo | |||||||||
trimItemsTo(len: number, items?: SzSearchHistoryFolioItem[])
|
|||||||||
used internally to keep stack at appropriate length
Parameters :
Returns :
SzSearchHistoryFolioItem[]
|
Public remove | ||||
remove(item)
|
||||
remove a SzFolioItem from "items" if it exists
Parameters :
Returns :
void
|
history |
gethistory()
|
gets the history folio items in decending chronological order
Returns :
SzSearchHistoryFolioItem[]
|