glebvvss/actionator

There is no license information available for the latest version (2.4.0) of this package.

Library for making executable actions

2.4.0 2020-08-25 07:40 UTC

This package is auto-updated.

Last update: 2024-04-25 15:43:01 UTC


README

Single atomic action (realizaton of "command" GoF pattern) for you own needs

Methods:

Action::execute() : self

Execute action and save result

Action::result($format = "") : mixed

Result of executed action. Can be prepared for client uses Format class name as first argument. Format class must implements Actionator\Format\FormatInterface for correct working.

Action::done(): bool

Returns true if action already executed

Actionator\Action

Base class for your own actions, which garantee that action will be executed once. For build your own actions you should extends this abstract class and implement code of your action in instionction abstract method

Methods:

Action::instruction() : mixed

Source code of action, which can be executed. Returns result of operation if needed.

Action::execute() : self

See Actionator\ActionInterface

Action::result($format = "") : mixed

See Actionator\ActionInterface

Action::done(): bool

See Actionator\ActionInterface

Actionator\ComplexAction

Sometimes you want to use collection of actions like an single atomic action. Complex action is simple implementation for this.

Methods:

Action::__construct(array $actions)

Provide collection of actions, which will execute like single action

Action::execute() : self

See Actionator\ActionInterface

Action::result($format = "") : array

See Actionator\ActionInterface

Action::done(): bool

See Actionator\ActionInterface