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
string
The extension name- app
CMSApplication|null
Application Object- db
DatabaseDriver|null
Database Driver Object
Response
mixed
createAssociation
Creates an association for the workflow_associations table
createAssociation( pk, state) :
since |
4.0.0 |
---|
Arguments
- pk
int
ID of the item- state
int
ID 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
int
The 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
int
The item ID to load
Response
stdClass|null
getComponent
Returns the booted component
getComponent() : \Joomla\CMS\Extension\ComponentInterface
getConditionName
Returns the translated condition name, based on the given number
getConditionName( value) :
since |
4.0.0 |
---|
Arguments
- value
int
The 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
int
The category ID.
Response
bool|int
An 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
int
The 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
int
The 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
extension
Name of the extension the workflow belong to
since |
4.0.0 |
---|
Type(s)
string
db
Database Driver
since |
4.0.0 |
---|
Type(s)
DatabaseDriver