CRM_Core_State
in package
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
Tags
Table of Contents
Constants
- FINISH = 2
- 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 = 4
- 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
- START = 1
- 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
- $_back : CRM_Core_State
- The state that precedes this state.
- $_name : string
- State name.
- $_next : CRM_Core_State
- The state that succeeds this state.
- $_stateMachine : CRM_Core_StateMachine
- The state machine that this state is part of.
- $_type : int
- This is a combination "OR" of the STATE_* constants defined below
Methods
- __construct() : CRM_Core_State
- Constructor.
- getName() : string
- Getter for name.
- getType() : int
- Getter for type.
- handleBackState() : mixed
- Given an CRM Form, jump to the previous page.
- handleNextState() : mixed
- Given an CRM Form, jump to the next page.
- invalidate() : mixed
- Mark this page as invalid for the QFC framework.
- setName() : mixed
- Setter for name.
- validate() : mixed
- Mark this page as valid for the QFC framework.
Constants
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
public
int
FINISH
= 2
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
public
int
SIMPLE
= 4
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
public
int
START
= 1
Properties
$_back
The state that precedes this state.
protected
CRM_Core_State
$_back
$_name
State name.
protected
string
$_name
$_next
The state that succeeds this state.
protected
CRM_Core_State
$_next
$_stateMachine
The state machine that this state is part of.
protected
CRM_Core_StateMachine
$_stateMachine
$_type
This is a combination "OR" of the STATE_* constants defined below
protected
int
$_type
Methods
__construct()
Constructor.
public
__construct(string $name, int $type, CRM_Core_State $back, CRM_Core_State $next, CRM_Core_StateMachine &$stateMachine) : CRM_Core_State
Parameters
- $name : string
-
Internal name of the state.
- $type : int
-
State type.
- $back : CRM_Core_State
-
State that precedes this state.
- $next : CRM_Core_State
-
State that follows this state.
- $stateMachine : CRM_Core_StateMachine
-
Statemachine that this states belongs to.
Return values
CRM_Core_StategetName()
Getter for name.
public
getName() : string
Return values
stringgetType()
Getter for type.
public
getType() : int
Return values
inthandleBackState()
Given an CRM Form, jump to the previous page.
public
handleBackState(CRM_Core_Form &$page) : mixed
Parameters
- $page : CRM_Core_Form
Return values
mixed —does a jump to the back state
handleNextState()
Given an CRM Form, jump to the next page.
public
handleNextState(CRM_Core_Form &$page) : mixed
Parameters
- $page : CRM_Core_Form
Return values
mixed —Does a jump to the nextstate
invalidate()
Mark this page as invalid for the QFC framework.
public
invalidate(array<string|int, mixed> &$data) : mixed
Parameters
- $data : array<string|int, mixed>
setName()
Setter for name.
public
setName(string $name) : mixed
Parameters
- $name : string
validate()
Mark this page as valid for the QFC framework.
public
validate(array<string|int, mixed> &$data) : mixed
Parameters
- $data : array<string|int, mixed>