class CRM_Core_State

The basic state element. Each state element is linked to a form and represents the form in the transition diagram. We use the state to determine what action to take on various user input. Actions include things like going back / stepping forward / process etc

Constants

START

The different types of states. As we flush out the framework more we will introduce other conditional / looping states which will bring in more complexity to the framework. For now, lets keep it simple

FINISH

The different types of states. As we flush out the framework more we will introduce other conditional / looping states which will bring in more complexity to the framework. For now, lets keep it simple

SIMPLE

The different types of states. As we flush out the framework more we will introduce other conditional / looping states which will bring in more complexity to the framework. For now, lets keep it simple

Properties

protected string $_name State name.
protected int $_type This is a combination "OR" of the STATE_* constants defined below
protected CRM_Core_State $_back The state that precedes this state.
protected CRM_Core_State $_next The state that succeeds this state.
protected CRM_Core_StateMachine $_stateMachine The state machine that this state is part of.

Methods

__construct(string $name, int $type, CRM_Core_State $back, CRM_Core_State $next, CRM_Core_StateMachine $stateMachine)

Constructor.

debugPrint()

No description

mixed
handleBackState(CRM_Core_Page $page)

Given an CRM Form, jump to the previous page.

mixed
handleNextState(CRM_Core_Page $page)

Given an CRM Form, jump to the next page.

string
getNextState()

Determine the name of the next state.

validate(array $data)

Mark this page as valid for the QFC framework.

invalidate(array $data)

Mark this page as invalid for the QFC framework.

string
getName()

Getter for name.

setName(string $name)

Setter for name.

int
getType()

Getter for type.

Details

at line 93
CRM_Core_State __construct(string $name, int $type, CRM_Core_State $back, CRM_Core_State $next, CRM_Core_StateMachine $stateMachine)

Constructor.

Parameters

string $name Internal name of the state.
int $type State type.
CRM_Core_State $back State that precedes this state.
CRM_Core_State $next State that follows this state.
CRM_Core_StateMachine $stateMachine Statemachine that this states belongs to.

Return Value

CRM_Core_State

at line 102
debugPrint()

at line 114
mixed handleBackState(CRM_Core_Page $page)

Given an CRM Form, jump to the previous page.

Parameters

CRM_Core_Page $page

Return Value

mixed does a jump to the back state

at line 132
mixed handleNextState(CRM_Core_Page $page)

Given an CRM Form, jump to the next page.

Parameters

CRM_Core_Page $page

Return Value

mixed Does a jump to the nextstate

at line 149
string getNextState()

Determine the name of the next state.

This is useful when we want to display the navigation labels or potential path.

Return Value

string

at line 164
validate(array $data)

Mark this page as valid for the QFC framework.

Parameters

array $data

at line 173
invalidate(array $data)

Mark this page as invalid for the QFC framework.

Parameters

array $data

at line 182
string getName()

Getter for name.

Return Value

string

at line 191
setName(string $name)

Setter for name.

Parameters

string $name

at line 200
int getType()

Getter for type.

Return Value

int