Back to Joomla project (class list)

Class Workflow - list of methods

Workflow Class.
Package: Joomla\CMS\Workflow
Copyright: (C) 2018 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Workflow/Workflow.php
Project: Joomla

Method Summary

public
(string $extension, ?\Joomla\CMS\Application\CMSApplication $app = null, ?\Joomla\Database\DatabaseDriver $db = null)

Class constructor
Parameters
  • string $extension The extension name
  • ?\Joomla\CMS\Application\CMSApplication $app Application Object
  • ?\Joomla\Database\DatabaseDriver $db Database Driver Object
Since
  • 4.0.0
Show source code of this method: __construct Source Code

public string
(int $value)

Returns the translated condition name, based on the given number
Parameters
  • int $value The condition ID
Returns
  • string
Since
  • 4.0.0
Show source code of this method: getConditionName Source Code

protected \Joomla\CMS\Extension\ComponentInterface
()

Returns the booted component
Returns
  • \Joomla\CMS\Extension\ComponentInterface
Since
  • 4.0.0
Show source code of this method: getComponent Source Code

public bool|int
(mixed $catId = 0)

Try to load a workflow default stage by category ID.
Parameters
  • int $catId The category ID.
Returns
  • bool|int An integer, holding the stage ID or false
Since
  • 4.0.0
Show source code of this method: getDefaultStageByCategory Source Code

public object
(array $pks, int $transitionId)

Check if a transition can be executed
Parameters
  • int[] $pks The item IDs, which should use the transition
  • int $transitionId The transition which should be executed
Returns
  • object | null
Show source code of this method: getValidTransition Source Code

public bool
(array $pks, int $transitionId)

Executes a transition to change the current state in the association table
Parameters
  • int[] $pks The item IDs, which should use the transition
  • int $transitionId The transition which should be executed
Returns
  • bool
Show source code of this method: executeTransition Source Code

public bool
(int $pk, int $state)

Creates an association for the workflow_associations table
Parameters
  • int $pk ID of the item
  • int $state ID of state
Returns
  • bool
Since
  • 4.0.0
Show source code of this method: createAssociation Source Code

public bool
(array $pks, int $state)

Update an existing association with a new state
Parameters
  • array $pks An Array of item IDs which should be changed
  • int $state The new state ID
Returns
  • bool
Since
  • 4.0.0
Show source code of this method: updateAssociations Source Code

public bool
(array $pks)

Removes associations from the workflow_associations table
Parameters
  • int[] $pks ID of content
Returns
  • bool
Since
  • 4.0.0
Show source code of this method: deleteAssociation Source Code

public \stdClass|null
(int $itemId)

Loads an existing association item with state and item ID
Parameters
  • int $itemId The item ID to load
Returns
  • \stdClass|null
Since
  • 4.0.0
Show source code of this method: getAssociation Source Code

Properties Summary

protected \Joomla\CMS\Extension\ComponentInterface
$component
The booted component
protected string
$extension
Name of the extension the workflow belong to
Since
  • 4.0.0
protected \Joomla\CMS\Application\CMSApplication
$app
Application Object
Since
  • 4.0.0
protected \Joomla\Database\DatabaseDriver
$db
Database Driver
Since
  • 4.0.0

Constants Summary

public
$CONDITION_NAMES
Condition to names mapping
Since
  • 4.0.0
public
$CONDITION_PUBLISHED
Every item with a state which has the condition PUBLISHED is visible/active on the page
public
$CONDITION_UNPUBLISHED
Every item with a state which has the condition UNPUBLISHED is not visible/inactive on the page
public
$CONDITION_TRASHED
Every item with a state which has the condition TRASHED is trashed
public
$CONDITION_ARCHIVED
Every item with a state which has the condition ARCHIVED is archived

Tags Summary

Since
4.0.0