class CRM_Import_StateMachine extends CRM_Core_StateMachine

State machine for managing different states of the Import process.

Properties

protected object $_controller The controller of this state machine. from CRM_Core_StateMachine
protected array $_states The list of states that belong to this state machine. from CRM_Core_StateMachine
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 from CRM_Core_StateMachine
protected array $_pageNames The names of the pages. from CRM_Core_StateMachine
protected int $_action The mode that the state machine is operating in. from CRM_Core_StateMachine
protected string $_name The display name for this machine. from CRM_Core_StateMachine

Methods

__construct(object $controller, const|int $action = CRM_Core_Action::NONE)

Class constructor.

string
getName()

Getter for name.

setName(string $name)

Setter for name.

object
perform(CRM_Core_Form $page, string $actionName, string $type = 'Next')

Do a state transition jump.

addState(string $name, int $type, object $prev, object $next)

Helper function to add a State to the state machine.

object
find(string $name)

Given a name find the corresponding state.

array
getStates()

Return the list of state objects.

getState(string $name)

Return the state object corresponding to the name.

array
getPages()

Return the list of form objects.

addSequentialPages(array $pages)

Add sequential pages.

reset()

Reset the state machine.

int
getAction()

Getter for action.

setContent(string $content)

Setter for content.

string
getContent()

Getter for content.

mixed
getDestination()

No description

mixed
getSkipRedirection()

No description

mixed
fini()

No description

mixed
cancelAction()

No description

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

Details

at line 45
CRM_Core_StateMachine __construct(object $controller, const|int $action = CRM_Core_Action::NONE)

Class constructor.

Parameters

object $controller The controller for this state machine.
const|int $action

Return Value

CRM_Core_StateMachine

in CRM_Core_StateMachine at line 105
string getName()

Getter for name.

Return Value

string

in CRM_Core_StateMachine at line 114
setName(string $name)

Setter for name.

Parameters

string $name

in CRM_Core_StateMachine 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

Parameters

CRM_Core_Form $page The current form-page.
string $actionName Current action name, as one Action object can serve multiple actions.
string $type The type of transition being requested (Next or Back).

Return Value

object

in CRM_Core_StateMachine at line 183
addState(string $name, int $type, object $prev, object $next)

Helper function to add a State to the state machine.

Parameters

string $name The internal name.
int $type The type of state (START|FINISH|SIMPLE).
object $prev The previous page if any.
object $next The next page if any.

in CRM_Core_StateMachine at line 196
object find(string $name)

Given a name find the corresponding state.

Parameters

string $name The state name.

Return Value

object the state object

in CRM_Core_StateMachine at line 211
array getStates()

Return the list of state objects.

Return Value

array array of states in the state machine

in CRM_Core_StateMachine at line 224
CRM_Core_State getState(string $name)

Return the state object corresponding to the name.

Parameters

string $name Name of page.

Return Value

CRM_Core_State state object matching the name

in CRM_Core_StateMachine at line 249
array getPages()

Return the list of form objects.

Return Value

array array of pages in the state machine

in CRM_Core_StateMachine 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.

Parameters

array $pages (reference ) the array of page objects.

in CRM_Core_StateMachine at line 316
reset()

Reset the state machine.

in CRM_Core_StateMachine at line 325
int getAction()

Getter for action.

Return Value

int

in CRM_Core_StateMachine at line 335
setContent(string $content)

Setter for content.

Parameters

string $content The content generated by this state machine.

in CRM_Core_StateMachine at line 344
string getContent()

Getter for content.

Return Value

string

in CRM_Core_StateMachine at line 351
mixed getDestination()

Return Value

mixed

in CRM_Core_StateMachine at line 358
mixed getSkipRedirection()

Return Value

mixed

in CRM_Core_StateMachine at line 365
mixed fini()

Return Value

mixed

in CRM_Core_StateMachine at line 372
mixed cancelAction()

Return Value

mixed

in CRM_Core_StateMachine 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

Return Value

bool