CodeCraft\Pathfinder\Model\Store\LocalStorageProgressStore
Uses the user's local storage to store a Pathfinder user's progress
This store uses an id and a timestamp to "sync" with the front end.
When the request provides an encoded copy, we pass it to the front-end
where it will be verified
Synopsis
class LocalStorageProgressStore
extends RequestVarProgressStore
{
- // members
- private static string $require_form_js = 'vendor/codecraft/silverstripe-pathfinder/client/dist/js/LocalStorageProgressStore.js';
- protected $timestamp;
- // Inherited members from RequestVarProgressStore
- protected $encodedProgress;
- // methods
- public void initAfterRequestHandler()
- public void updateForm()
- public string getTimestamp()
- public string|void getEncodedStore()
- public void getDecodedStore()
- // Inherited methods from RequestVarProgressStore
- public void __construct()
- public static void encode()
- public static array decode()
- public string getProgressVarName()
- public string getEncodedProgress()
- public string getEncodedStore()
- public array getDecodedStore()
- public string mergeRequestVarsWithURL()
- public void augmentURL()
- // Inherited methods from ProgressStore
- public void initAfterRequestHandler()
- public ProgressStore add()
- public array get()
- public ProgressStore set()
- public ProgressStore clear()
- public ProgressStore clearAfterPos()
- public ProgressStore addProgress()
- public Pathfinder getHandler()
- public ProgressStore setHandler()
- public void updateForm()
- public string augmentURL()
- public string getStorageName()
- public ProgressEntry|null getByPos()
- public array toArray()
- public int count()
- public ProgressEntry|null last()
- public bool canValidateSequence()
- public bool|null isInSequence()
Hierarchy
Members
private
- $require_form_js
—
string
Should include the `.js` in the filename
protected
- $encodedProgress — string
- $entries — array
- $handler — CodeCraft\Pathfinder\Model\Pathfinder
- $timestamp — string
Methods
public
- getDecodedStore() — {@inheritDoc}
- getEncodedStore()
- getTimestamp()
- initAfterRequestHandler() — {@inheritDoc}
- updateForm() — {@inheritDoc}
Inherited from CodeCraft\Pathfinder\Model\Store\RequestVarProgressStore
public
- augmentURL() — {@inheritDoc}
- decode()
- encode()
- getDecodedStore()
- getEncodedProgress()
- getEncodedStore() — Gzip, Base64 and URL encode the store
- getProgressVarName()
- mergeRequestVarsWithURL()
Inherited from CodeCraft\Pathfinder\Model\Store\ProgressStore
public
- add() — Add an item to the current progress
- addProgress() — Add progress by question, answer and choices
- augmentURL() — Modify the redirect url used to continue to the next step in the pathfinder
- canValidateSequence() — A heuristic for whether this story can/should determine if a specific question is the next in sequence
- clear() — Clear the current progress store
- clearAfterPos()
- count()
- get() — Get the current progress
- getByPos()
- getHandler()
- getStorageName()
- initAfterRequestHandler()
- isInSequence() — Determines if a question is the next in sequence
- last()
- set() — Set the current progress
- setHandler()
- toArray()
- updateForm() — Invoked as part of {@see PathfinderRequestHandler::Form()}