CRM_Core_StateMachine
class CRM_Core_StateMachine
Core StateMachine.
All state machines subclass for the core one for functionality specific to their needs.
A state machine keeps track of different states and forms for a html quickform controller.
Properties
protected object | $_controller | The controller of this state machine. | |
protected array | $_states | The list of states that belong to this state machine. | |
protected array | $_pages | The list of pages that belong to this state machine. Note that a state and a form have a 1 <-> 1 relationship. so u can always derive one from the other | |
protected array | $_pageNames | The names of the pages. | |
protected int | $_action | The mode that the state machine is operating in. | |
protected string | $_name | The display name for this machine. |
Methods
Class constructor.
Getter for name.
Setter for name.
Helper function to add a State to the state machine.
Given a name find the corresponding state.
Return the list of state objects.
Return the state object corresponding to the name.
Return the list of form objects.
Add sequential pages.
Reset the state machine.
Getter for action.
Setter for content.
Getter for content.
No description
No description
No description
No description
Should the controller reset the session In some cases, specifically search we want to remember state across various actions and want to go back to the beginning from the final state, but retain the same session values
Details
at line 93
CRM_Core_StateMachine
__construct(object $controller, const|int $action = CRM_Core_Action::NONE)
Class constructor.
at line 105
string
getName()
Getter for name.
at line 114
setName(string $name)
Setter for name.
at line 134
object
perform(CRM_Core_Form $page, string $actionName, string $type = 'Next')
Do a state transition jump.
Currently only supported types are Next and Back. The other actions (Cancel, Done, Submit etc) do not need the state machine to figure out where to go
at line 183
addState(string $name, int $type, object $prev, object $next)
Helper function to add a State to the state machine.
at line 196
object
find(string $name)
Given a name find the corresponding state.
at line 211
array
getStates()
Return the list of state objects.
at line 224
CRM_Core_State
getState(string $name)
Return the state object corresponding to the name.
at line 249
array
getPages()
Return the list of form objects.
at line 261
addSequentialPages(array $pages)
Add sequential pages.
Meta level function to create a simple wizard for a state machine that is completely sequential.
at line 316
reset()
Reset the state machine.
at line 325
int
getAction()
Getter for action.
at line 335
setContent(string $content)
Setter for content.
at line 344
string
getContent()
Getter for content.
at line 351
mixed
getDestination()
at line 358
mixed
getSkipRedirection()
at line 365
mixed
fini()
at line 372
mixed
cancelAction()
at line 385
bool
shouldReset()
Should the controller reset the session In some cases, specifically search we want to remember state across various actions and want to go back to the beginning from the final state, but retain the same session values