SilverStripe\MultiForm\Tests\Stubs\MultiFormTestForm
Synopsis
class MultiFormTestForm
extends MultiForm
implements
TestOnly
{
- // members
- private static $start_step = MultiFormTestStepOne::class;
- // Inherited members from MultiForm
- protected MultiFormSession $session;
- protected $currentSessionHash;
- protected $displayLink;
- protected boolean $currentStepHasBeenFound;
- // methods
- public void getStartStep()
- // Inherited methods from MultiForm
- public void __construct()
- public Controller getController()
- public string getGetVar()
- public MultiFormStep getCurrentStep()
- protected boolean setCurrentStep()
- public MultiFormSession getMultiFormSession()
- protected void setSession()
- public void setCurrentSessionHash()
- public MultiFormSession|boolean getCurrentSession()
- public DataList|boolean getSavedSteps()
- public DataObject getSavedStepByClass()
- public FieldList actionsFor()
- public bool finish()
- public bool next()
- public bool|HTTPResponse prev()
- protected void save()
- public string FormAction()
- public string getDisplayLink()
- public void setDisplayLink()
- public ArrayList getAllStepsLinear()
- protected DataList getAllStepsRecursive()
- public int getCompletedStepCount()
- public int getTotalStepCount()
- public float getCompletedPercent()
Hierarchy
Tasks
Line | Task |
---|---|
299+ | Fix the fact you can continually refresh and create new records if MultiFormSessionID isn't set. |
299+ | Not sure if we should bake the session stuff directly into MultiForm. Perhaps it would be best dealt with on a separate class? |
698+ | Not sure if it's entirely appropriate to check if Data is set as a way to determine a step is "completed". |
Members
private
- $start_step
protected
- $currentSessionHash
—
string
The current encrypted MultiFormSession identification. - $currentStepHasBeenFound
—
boolean
Flag which is being used in getAllStepsRecursive() to allow adding the completed flag on the steps - $displayLink — string
- $session
—
SilverStripe\MultiForm\Models\MultiFormSession
A session object stored in the database, to identify and store data for this MultiForm instance.
Methods
public
Inherited from SilverStripe\MultiForm\Forms\MultiForm
protected
- getAllStepsRecursive() — Recursively run through steps using the getNextStep() method on each step to determine what the next step is, gathering each step along the way.
- save() — Save the raw data given back from the form into session.
- setCurrentStep() — Set the step passed in as the current step.
- setSession() — Set up the session.
public
- FormAction() — Add the MultiFormSessionID variable to the URL on form submission.
- actionsFor() — Build a FieldList of the FormAction fields for the given step.
- finish() — This method saves the data on the final step, after submitting.
- getAllStepsLinear() — Determine the steps to show in a linear fashion, starting from the first step. We run {@link getAllStepsRecursive} passing the steps found by reference to get a listing of the steps.
- getCompletedPercent() — Percentage of steps completed (excluding currently started step)
- getCompletedStepCount() — Number of steps already completed (excluding currently started step).
- getController() — Accessor method to $this->controller.
- getCurrentSession() — Return the currently used {@link MultiFormSession}
- getCurrentStep() — Get the current step.
- getDisplayLink() — Returns the link to the page where the form is displayed. The user is redirected to this link with a session param after each step is submitted.
- getGetVar() — Returns the get_var to the template engine
- getMultiFormSession() — Accessor method to $this->session.
- getSavedStepByClass() — Get a step which was previously saved to the database in the current session.
- getSavedSteps() — Get all steps saved in the database for the currently active session, in the order they were saved, oldest to newest (automatically ordered by ID).
- getTotalStepCount() — Total number of steps in the shortest path (only counting straight path without any branching) The way we determine this is to check if each step has a next_step string variable set. If it's anything else (like an array, for defining multiple branches) then it gets counted as a single step.
- next() — Determine what to do when the next action is called.
- prev() — Determine what to do when the previous action is called.
- setCurrentSessionHash() — Set the currently used encrypted hash to identify the MultiFormSession.
- setDisplayLink() — Set the link to the page on which the form is displayed.