Action
in package
implements
ActionInterface
Uses
Descriptor
AbstractYes
Base class for all actions
Table of Contents
Interfaces
- ActionInterface
- Action interface
Properties
- $description : string|null
- Action description
- $descriptor : object|null
- Descriptor instance
- $descriptorClass : null|string
- Descriptor class
- $error : mixed|null
- Execution error
- $name : string|null
- Action name
- $options : array<string|int, mixed>
- Action options
- $result : array<string|int, mixed>
- Result data
- $title : string|null
- Action title
Methods
- __construct() : mixed
- Constructor
- __get() : mixed
- Get result value
- __invoke() : void
- Run action
- __set() : void
- Set
- description() : void
- Set description
- descriptor() : object|null
- Get descriptor
- error() : ActionInterface
- Set error
- get() : mixed
- Get result field
- getDescription() : string|null
- Get description
- getError() : mixed
- Get execution error
- getName() : string|null
- Get name
- getOption() : mixed
- Get option value
- getOptions() : array<string|int, mixed>
- Get options
- getResult() : array<string|int, mixed>
- Get result
- getTitle() : string|null
- Get title
- hasError() : bool
- Return true if action is executed successful
- init() : void
- Init action
- name() : void
- Set name
- option() : ActionInterface
- Set option
- result() : ActionInterface
- Set result field
- run() : mixed
- Run action
- setDescriptorClass() : void
- Set descriptor class
- setOptions() : void
- Set options
- title() : void
- Set title
- toArray() : array<string|int, mixed>
- Convert to array
- initDescriptor() : void
- Init descriptor properties
Properties
$description
Action description
protected
string|null
$description
= null
$descriptor
Descriptor instance
protected
object|null
$descriptor
= null
$descriptorClass
Descriptor class
protected
null|string
$descriptorClass
= null
$error
Execution error
protected
mixed|null
$error
= null
$name
Action name
protected
string|null
$name
= null
$options
Action options
protected
array<string|int, mixed>
$options
$result
Result data
protected
array<string|int, mixed>
$result
= []
$title
Action title
protected
string|null
$title
= null
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $options : array<string|int, mixed> = []
__get()
Get result value
public
__get(string $name) : mixed
Parameters
- $name : string
__invoke()
Run action
public
__invoke(mixed ...$params) : void
Parameters
- $params : mixed
__set()
Set
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
description()
Set description
public
description(string $description) : void
Parameters
- $description : string
descriptor()
Get descriptor
public
descriptor() : object|null
Return values
object|nullerror()
Set error
public
error(mixed $error) : ActionInterface
Parameters
- $error : mixed
Return values
ActionInterfaceget()
Get result field
public
get(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
getDescription()
Get description
public
getDescription() : string|null
Return values
string|nullgetError()
Get execution error
public
getError() : mixed
getName()
Get name
public
getName() : string|null
Return values
string|nullgetOption()
Get option value
public
getOption(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
getOptions()
Get options
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getResult()
Get result
public
getResult() : array<string|int, mixed>
Return values
array<string|int, mixed>getTitle()
Get title
public
getTitle() : string|null
Return values
string|nullhasError()
Return true if action is executed successful
public
hasError() : bool
Return values
boolinit()
Init action
public
init() : void
name()
Set name
public
name(string $name) : void
Parameters
- $name : string
option()
Set option
public
option(string $name, mixed $value) : ActionInterface
Parameters
- $name : string
- $value : mixed
Return values
ActionInterfaceresult()
Set result field
public
result(string $name, mixed $value) : ActionInterface
Parameters
- $name : string
- $value : mixed
Return values
ActionInterfacerun()
Run action
public
abstract run(mixed ...$params) : mixed
Parameters
- $params : mixed
setDescriptorClass()
Set descriptor class
public
setDescriptorClass(string $class) : void
Parameters
- $class : string
setOptions()
Set options
public
setOptions(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
title()
Set title
public
title(string $title) : void
Parameters
- $title : string
toArray()
Convert to array
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>initDescriptor()
Init descriptor properties
protected
initDescriptor() : void