Workflow

Workflow Class.

since

4.0.0

package

Joomla CMS

Methods

__construct

Class constructor

__construct( extension, \Joomla\CMS\Application\CMSApplication app = null, \Joomla\Database\DatabaseDriver db = null) : 
since

4.0.0

Arguments

extension

stringThe extension name

app

CMSApplication|nullApplication Object

db

DatabaseDriver|nullDatabase Driver Object

Response

mixed

createAssociation

Creates an association for the workflow_associations table

createAssociation( pk,  state) : 
since

4.0.0

Arguments

pk

intID of the item

state

intID of state

Response

bool

deleteAssociation

Removes associations from the workflow_associations table

deleteAssociation(int||string|int pks) : 
since

4.0.0

Arguments

pks

array<string|int, int>ID of content

Response

bool

executeTransition

Executes a transition to change the current state in the association table

executeTransition(int||string|int pks,  transitionId) : 

Arguments

pks

array<string|int, int>The item IDs, which should use the transition

transitionId

intThe transition which should be executed

Response

bool

getAssociation

Loads an existing association item with state and item ID

getAssociation( itemId) : \stdClass|null
since

4.0.0

Arguments

itemId

intThe item ID to load

Response

stdClass|null

getComponent

Returns the booted component

getComponent() : \Joomla\CMS\Extension\ComponentInterface
since

4.0.0

Response

ComponentInterface

getConditionName

Returns the translated condition name, based on the given number

getConditionName( value) : 
since

4.0.0

Arguments

value

intThe condition ID

Response

string

getDefaultStageByCategory

Try to load a workflow default stage by category ID.

getDefaultStageByCategory( catId) : bool|int
since

4.0.0

Arguments

catId

intThe category ID.

Response

bool|intAn integer, holding the stage ID or false

getValidTransition

Check if a transition can be executed

getValidTransition(int||string|int pks,  transitionId) : 

Arguments

pks

array<string|int, int>The item IDs, which should use the transition

transitionId

intThe transition which should be executed

Response

object| null

updateAssociations

Update an existing association with a new state

updateAssociations(mixed||string|int pks,  state) : 
since

4.0.0

Arguments

pks

array<string|int, mixed>An Array of item IDs which should be changed

state

intThe new state ID

Response

bool

Constants

CONDITION_NAMES

Condition to names mapping

Value [self::CONDITION_PUBLISHED => 'JPUBLISHED', self::CONDITION_UNPUBLISHED => 'JUNPUBLISHED', self::CONDITION_TRASHED => 'JTRASHED', self::CONDITION_ARCHIVED => 'JARCHIVED']
since

4.0.0

CONDITION_PUBLISHED

Every item with a state which has the condition PUBLISHED is visible/active on the page

Value 1

CONDITION_UNPUBLISHED

Every item with a state which has the condition UNPUBLISHED is not visible/inactive on the page

Value 0

CONDITION_TRASHED

Every item with a state which has the condition TRASHED is trashed

Value -2

CONDITION_ARCHIVED

Every item with a state which has the condition ARCHIVED is archived

Value 2

Properties

component

The booted component

extension

Name of the extension the workflow belong to

since

4.0.0

Type(s)

string

app

Application Object

since

4.0.0

Type(s)

CMSApplication

db

Database Driver

since

4.0.0

Type(s)

DatabaseDriver