Workflow

Workflow Class.

since

4.0.0

package

Application

Methods

__construct

Class constructor

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

4.0.0

Arguments

extension

stringThe extension name

app

?\Joomla\CMS\Application\CMSApplicationApplication Object

db

?\Joomla\Database\DatabaseDriverDatabase Driver Object

Response

mixed

createAssociation

Creates an association for the workflow_associations table

createAssociation(int pk, int state) : bool
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[] pks) : bool
since

4.0.0

Arguments

pks

int[]ID of content

Response

bool

executeTransition

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

executeTransition(int[] pks, int transitionId) : bool

Arguments

pks

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(int 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

\Joomla\CMS\Extension\ComponentInterface

getConditionName

Returns the translated condition name, based on the given number

getConditionName(int value) : string
since

4.0.0

Arguments

value

intThe condition ID

Response

string

getDefaultStageByCategory

Try to load a workflow default stage by category ID.

getDefaultStageByCategory(int 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[] pks, int transitionId) : object

Arguments

pks

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(array pks, int state) : bool
since

4.0.0

Arguments

pks

arrayAn 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)

\Joomla\Database\DatabaseDriver