Workflow
Workflow Class.
since |
4.0.0 |
---|---|
package |
Joomla CMS |
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
string
The extension name- app
?\Joomla\CMS\Application\CMSApplication
Application Object- db
?\Joomla\Database\DatabaseDriver
Database 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
int
ID of the item- state
int
ID 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
int
The 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
int
The 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
int
The 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
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[] pks, int transitionId) : object
Arguments
- pks
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(array pks, int state) : bool
since |
4.0.0 |
---|
Arguments
- pks
array
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
component
The booted component
Type(s)
\Joomla\CMS\Extension\ComponentInterface
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)
\Joomla\CMS\Application\CMSApplication
db
Database Driver
since |
4.0.0 |
---|
Type(s)
\Joomla\Database\DatabaseDriver