PHP 클래스 Pimcore\WorkflowManagement\Workflow\Manager

파일 보기 프로젝트 열기: pimcore/pimcore 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$actionData The data submitted when an action is performed
$element Pimcore\Model\Object\Concrete | Pimcore\Model\Document | Pimcore\Model\Asset The element for this workflow
$error mixed Any errors within the workflow will be stored here
$registeredActionEvents array An array of the event triggers that are registered with an action
$user Pimcore\Model\User The user using the workflow All actions will be recorded against this user
$userIds array An array of the different pimcore user ids that the current user is related to - first in array is the users id, - any additional are the role ids that have been assigned to the user
$workflow Pimcore\WorkflowManagement\Workflow The loaded workflow

공개 메소드들

메소드 설명
__construct ( $element, null $user = null )
actionHasTransition ( $actionConfig )
elementCanAction ( $element ) : boolean Returns whether or not an element can be actioned
elementHasWorkflow ( AbstractElement $element ) : boolean Returns whether or not an element has a workflow
getActionData ( )
getAdditionalFieldsForAction ( $actionName ) : array | mixed Shortcut method - probably should clean this up a bit more
getAvailableActions ( ) : mixed Get the available actions that can be performed on an element
getAvailableStates ( $actionName ) : array Returns the available state configurations given an action NOTE: ASSUMES THE ACTION EXISTS
getAvailableStatuses ( $actionName, $stateName ) : array Returns the available statuses given an action and a state
getElement ( )
getElementState ( ) : string Return the element state
getElementStatus ( ) Returns the current status of an object
getError ( )
getNotesRequiredForAction ( string $actionName ) : boolean Returns whether or not notes are required for a given action on the current object Assumes the action is valid at that point in time
getObjectLayout ( ) : string | null Returns the objects layout configuration given the current place in the workflow If no layout is specified then null will be returned
getUser ( )
getWorkflow ( ) : Pimcore\WorkflowManagement\Workflow
getWorkflowStateForElement ( ) : null | WorkflowState
performAction ( mixed $actionName, array $formData = [] ) Performs an action
setActionData ( $data )
setElementState ( $newState )
setElementStatus ( $newStatus )
userCanPerformAction ( $actionName, null $statusName = null ) : boolean Returns whether or not a user can perform an action if a status is given then it will be taken into consideration
validateAction ( $actionName, $newState, $newStatus ) : boolean Validates that a transition between requested states can be done on an element NOTE: DOES NOT VALIDATE FIELDS @see performAction

비공개 메소드들

메소드 설명
initUserIds ( )
initWorkflow ( ) Loads the workflow into the manager
registerActionEvents ( $actionConfig ) Used by performAction to initialise events
unregisterActionEvents ( ) Unregisters events (before, success, failure)

메소드 상세

__construct() 공개 메소드

public __construct ( $element, null $user = null )
$element
$user null - optional parameter so that importers can use some functions of manager too.

actionHasTransition() 공개 메소드

public actionHasTransition ( $actionConfig )

elementCanAction() 공개 정적인 메소드

Returns whether or not an element can be actioned
public static elementCanAction ( $element ) : boolean
$element
리턴 boolean

elementHasWorkflow() 공개 정적인 메소드

Returns whether or not an element has a workflow
public static elementHasWorkflow ( AbstractElement $element ) : boolean
$element Pimcore\Model\Element\AbstractElement
리턴 boolean

getActionData() 공개 메소드

public getActionData ( )

getAdditionalFieldsForAction() 공개 메소드

Shortcut method - probably should clean this up a bit more
public getAdditionalFieldsForAction ( $actionName ) : array | mixed
$actionName
리턴 array | mixed

getAvailableActions() 공개 메소드

Get the available actions that can be performed on an element
public getAvailableActions ( ) : mixed
리턴 mixed

getAvailableStates() 공개 메소드

Returns the available state configurations given an action NOTE: ASSUMES THE ACTION EXISTS
또한 보기: self::isValidAction
public getAvailableStates ( $actionName ) : array
$actionName
리턴 array

getAvailableStatuses() 공개 메소드

Returns the available statuses given an action and a state
public getAvailableStatuses ( $actionName, $stateName ) : array
$actionName
$stateName
리턴 array

getElement() 공개 메소드

public getElement ( )

getElementState() 공개 메소드

Return the element state
public getElementState ( ) : string
리턴 string

getElementStatus() 공개 메소드

Returns the current status of an object
public getElementStatus ( )

getError() 공개 메소드

public getError ( )

getNotesRequiredForAction() 공개 메소드

Returns whether or not notes are required for a given action on the current object Assumes the action is valid at that point in time
public getNotesRequiredForAction ( string $actionName ) : boolean
$actionName string
리턴 boolean

getObjectLayout() 공개 메소드

Returns the objects layout configuration given the current place in the workflow If no layout is specified then null will be returned
public getObjectLayout ( ) : string | null
리턴 string | null

getUser() 공개 메소드

public getUser ( )

getWorkflow() 공개 메소드

public getWorkflow ( ) : Pimcore\WorkflowManagement\Workflow
리턴 Pimcore\WorkflowManagement\Workflow

getWorkflowStateForElement() 공개 메소드

public getWorkflowStateForElement ( ) : null | WorkflowState
리턴 null | Pimcore\Model\Element\WorkflowState

performAction() 공개 메소드

Performs an action
public performAction ( mixed $actionName, array $formData = [] )
$actionName mixed
$formData array

setActionData() 공개 메소드

public setActionData ( $data )

setElementState() 공개 메소드

public setElementState ( $newState )

setElementStatus() 공개 메소드

public setElementStatus ( $newStatus )

userCanPerformAction() 공개 메소드

Returns whether or not a user can perform an action if a status is given then it will be taken into consideration
public userCanPerformAction ( $actionName, null $statusName = null ) : boolean
$actionName
$statusName null
리턴 boolean

validateAction() 공개 메소드

Validates that a transition between requested states can be done on an element NOTE: DOES NOT VALIDATE FIELDS @see performAction
public validateAction ( $actionName, $newState, $newStatus ) : boolean
$actionName
$newState
$newStatus
리턴 boolean

프로퍼티 상세

$actionData 보호되어 있는 프로퍼티

The data submitted when an action is performed
protected $actionData

$element 보호되어 있는 프로퍼티

The element for this workflow
protected Concrete,Pimcore\Model\Object|Document,Pimcore\Model|Asset,Pimcore\Model $element
리턴 Pimcore\Model\Object\Concrete | Pimcore\Model\Document | Pimcore\Model\Asset

$error 보호되어 있는 프로퍼티

Any errors within the workflow will be stored here
protected mixed $error
리턴 mixed

$registeredActionEvents 보호되어 있는 프로퍼티

An array of the event triggers that are registered with an action
protected array $registeredActionEvents
리턴 array

$user 보호되어 있는 프로퍼티

The user using the workflow All actions will be recorded against this user
protected User,Pimcore\Model $user
리턴 Pimcore\Model\User

$userIds 보호되어 있는 프로퍼티

An array of the different pimcore user ids that the current user is related to - first in array is the users id, - any additional are the role ids that have been assigned to the user
protected array $userIds
리턴 array

$workflow 보호되어 있는 프로퍼티

The loaded workflow
protected Workflow,Pimcore\WorkflowManagement $workflow
리턴 Pimcore\WorkflowManagement\Workflow