ActionFactory
Factory for create actions
Table of Contents
Constants
- MULTIPLY_ACTION_NAME = 'MULTIPLY'
Methods
- compareSteps() : bool
- No need processing steps if there are equal. Compare for match it
- getAction() : BaseAction|null
- getActionClass() : string|null
- Get action class by direction (undo or redo)
- getDirectionName() : string
- Get name of direction by bool
- isActionExists() : bool
- Check correctly action name
Constants
MULTIPLY_ACTION_NAME
public
mixed
MULTIPLY_ACTION_NAME
= 'MULTIPLY'
Methods
compareSteps()
No need processing steps if there are equal. Compare for match it
public
static compareSteps(array<string|int, mixed> $prevStep, array<string|int, mixed> $nextStep) : bool
Parameters
- $prevStep : array<string|int, mixed>
-
array of step data
- $nextStep : array<string|int, mixed>
-
array of step data
Return values
bool —true if steps are equal
getAction()
public
static getAction(string $actionName[, bool|null $undo = false ]) : BaseAction|null
Parameters
- $actionName : string
-
- just available actions
- $undo : bool|null = false
-
- if need redo - false
Return values
BaseAction|nullgetActionClass()
Get action class by direction (undo or redo)
public
static getActionClass(string $actionName[, bool $undo = false ]) : string|null
Parameters
- $actionName : string
- $undo : bool = false
-
- if need redo - false
Return values
string|nullgetDirectionName()
Get name of direction by bool
public
static getDirectionName([bool|null $undo = false ]) : string
Parameters
- $undo : bool|null = false
-
default false (redo)
Return values
stringisActionExists()
Check correctly action name
public
static isActionExists(string $actionName) : bool
Parameters
- $actionName : string