PHP 클래스 raoul2000\workflow\events\WorkflowEvent

상속: extends yii\base\ModelEvent
파일 보기 프로젝트 열기: raoul2000/yii2-workflow 1 사용 예제들

공개 메소드들

메소드 설명
__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.