PHP Класс raoul2000\workflow\events\WorkflowEvent

Наследование: extends yii\base\ModelEvent
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $name, array $config = [] ) Create a WorkflowEvent instance.
afterChangeStatus ( string $start, string $end ) : string Create name for a *after change status* event.
afterEnterStatus ( string $status = self::ANY_STATUS ) : string Create name for a *after enter status* event.
afterEnterWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string Create name for a *after enter workflow* event.
afterLeaveStatus ( string $status = self::ANY_STATUS ) : string Create name for a *after leave status* event.
afterLeaveWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string Create name for a *after leave workflow* event.
beforeChangeStatus ( string $start, string $end ) : string Create name for a *before change status* event.
beforeEnterStatus ( string $status = self::ANY_STATUS ) : string Create name for a *before enter status* event.
beforeEnterWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string Create name for a *before enter workflow* event.
beforeLeaveStatus ( string $status = self::ANY_STATUS ) : string Create name for a *before leave status* event.
beforeLeaveWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string Create name for a *before leave workflow* event.
getEndStatus ( ) : Status Get the final status reached by the model when this event occured.
getErrors ( ) : string[] Returns an array containg all error messages.
getStartStatus ( ) : Status Get the status the model what into before this event occured.
getTransition ( ) : raoul2000\workflow\Transition Get the transition concerned by this event.
invalidate ( string $message = null, boolean $handled = false ) Invalidate this event.

Приватные методы

Метод Описание
_checkNonEmptyString ( mixed $argName, mixed $argValue ) Test if $argValue is empty.

Описание методов

__construct() публичный Метод

Create a WorkflowEvent instance.
public __construct ( string $name, array $config = [] )
$name string name of the event.
$config array configuration array that may contain following keys : 'start', 'end', 'transition'

afterChangeStatus() публичный статический Метод

Create name for a *after change status* event.
public static afterChangeStatus ( string $start, string $end ) : string
$start string ID of the status which is at the start of the transition (the status that is left)
$end string ID of the status which is at the end of the transition (the status that is reached)
Результат string name of the event

afterEnterStatus() публичный статический Метод

Create name for a *after enter status* event.
public static afterEnterStatus ( string $status = self::ANY_STATUS ) : string
$status string the status name or any status if not set
Результат string name of the event

afterEnterWorkflow() публичный статический Метод

Create name for a *after enter workflow* event.
public static afterEnterWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string
$workflowId string the workflow id or any workflow id if not set
Результат string name of the event

afterLeaveStatus() публичный статический Метод

Create name for a *after leave status* event.
public static afterLeaveStatus ( string $status = self::ANY_STATUS ) : string
$status string the status name or any status if not set
Результат string name of the event

afterLeaveWorkflow() публичный статический Метод

Create name for a *after leave workflow* event.
public static afterLeaveWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string
$workflowId string the workflow id or any workflow id if not set
Результат string name of the event

beforeChangeStatus() публичный статический Метод

Create name for a *before change status* event.
public static beforeChangeStatus ( string $start, string $end ) : string
$start string ID of the status which is at the start of the transition (the status that is left)
$end string ID of the status which is at the end of the transition (the status that is reached)
Результат string name of the event

beforeEnterStatus() публичный статический Метод

Create name for a *before enter status* event.
public static beforeEnterStatus ( string $status = self::ANY_STATUS ) : string
$status string the status name or any status if not set
Результат string name of the event

beforeEnterWorkflow() публичный статический Метод

Create name for a *before enter workflow* event.
public static beforeEnterWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string
$workflowId string the workflow id or any workflow id if not set
Результат string name of the event

beforeLeaveStatus() публичный статический Метод

Create name for a *before leave status* event.
public static beforeLeaveStatus ( string $status = self::ANY_STATUS ) : string
$status string the status name or any status if not set
Результат string name of the event

beforeLeaveWorkflow() публичный статический Метод

Create name for a *before leave workflow* event.
public static beforeLeaveWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string
$workflowId string the workflow id or any workflow id if not set
Результат string name of the event

getEndStatus() публичный Метод

In case the model is leaving the workflow, this method returns NULL.
public getEndStatus ( ) : Status
Результат raoul2000\workflow\base\Status the end status involved in this event

getErrors() публичный Метод

An error message can be set by calling the *invalidate()* method.
public getErrors ( ) : string[]
Результат string[] the list of error messages

getStartStatus() публичный Метод

In case the model is entering the workflow, this method returns NULL.
public getStartStatus ( ) : Status
Результат raoul2000\workflow\base\Status the start status involved in this event

getTransition() публичный Метод

Get the transition concerned by this event.
См. также: raoul2000\workflow\base\Transition
public getTransition ( ) : raoul2000\workflow\Transition
Результат raoul2000\workflow\Transition the transition involved in this event or NULL if no transition is available (e.g. EnterWorkflow, LeaveWorkflow)

invalidate() публичный Метод

Calling this method is equivalent to setting the *isValid* property to false. Additionnally a message can be added to the internal error message queue. If $handled is set to true, following event handlers that may be installed for this event will not be invoked.
См. также: http://www.yiiframework.com/doc-2.0/guide-concept-events.html#event-handler-order
См. также: http://www.yiiframework.com/doc-2.0/yii-base-event.html#$handled-detail
public invalidate ( string $message = null, boolean $handled = false )
$message string error message
$handled boolean Whether the event is handled. Defaults to false. When a handler sets this to be true, the event processing will stop and ignore the rest of the uninvoked event handlers.