class WorkflowType
Same name in other branches
- 9 core/modules/workflows/src/Annotation/WorkflowType.php \Drupal\workflows\Annotation\WorkflowType
- 8.9.x core/modules/workflows/src/Annotation/WorkflowType.php \Drupal\workflows\Annotation\WorkflowType
- 11.x core/modules/workflows/src/Attribute/WorkflowType.php \Drupal\workflows\Attribute\WorkflowType
- 11.x core/modules/workflows/src/Annotation/WorkflowType.php \Drupal\workflows\Annotation\WorkflowType
Defines a Workflow type attribute object.
Plugin Namespace: Plugin\WorkflowType
For a working example, see \Drupal\content_moderation\Plugin\Workflow\ContentModerate
Attributes
#[\Attribute(\Attribute::TARGET_CLASS)]
Hierarchy
- class \Drupal\workflows\Attribute\WorkflowType extends \Drupal\Component\Plugin\Attribute\Plugin
Expanded class hierarchy of WorkflowType
See also
\Drupal\workflows\WorkflowTypeInterface
\Drupal\workflows\WorkflowTypeManager
workflow_type_info_alter()
7 files declare their use of WorkflowType
- ComplexTestType.php in core/
modules/ workflows/ tests/ modules/ workflow_type_test/ src/ Plugin/ WorkflowType/ ComplexTestType.php - ContentModeration.php in core/
modules/ content_moderation/ src/ Plugin/ WorkflowType/ ContentModeration.php - PredefinedStatesWorkflowTestType.php in core/
modules/ workflows/ tests/ modules/ workflow_type_test/ src/ Plugin/ WorkflowType/ PredefinedStatesWorkflowTestType.php - RequiredStateTestType.php in core/
modules/ workflows/ tests/ modules/ workflow_type_test/ src/ Plugin/ WorkflowType/ RequiredStateTestType.php - TestType.php in core/
modules/ workflows/ tests/ modules/ workflow_type_test/ src/ Plugin/ WorkflowType/ TestType.php
File
-
core/
modules/ workflows/ src/ Attribute/ WorkflowType.php, line 20
Namespace
Drupal\workflows\AttributeView source
class WorkflowType extends Plugin {
/**
* States required to exist.
*
* Normally supplied by WorkflowType::defaultConfiguration().
*/
public array $required_states = [];
/**
* A list of optional form classes implementing PluginFormInterface.
*
* Forms which will be used for the workflow UI are:
* - 'configure' (\Drupal\workflows\WorkflowTypeInterface::PLUGIN_FORM_KEY)
* - 'state' (\Drupal\workflows\StateInterface::PLUGIN_FORM_KEY)
* - 'transition' (\Drupal\workflows\TransitionInterface::PLUGIN_FORM_KEY)
*
* @see \Drupal\Core\Plugin\PluginWithFormsInterface
* @see \Drupal\Core\Plugin\PluginFormInterface
* @see \Drupal\workflows\Plugin\WorkflowTypeConfigureFormBase
* @see \Drupal\workflows\Plugin\WorkflowTypeStateFormBase
* @see \Drupal\workflows\Plugin\WorkflowTypeTransitionFormBase
* @see \Drupal\workflows\WorkflowTypeInterface::PLUGIN_FORM_KEY
* @see \Drupal\workflows\StateInterface::PLUGIN_FORM_KEY
* @see \Drupal\workflows\TransitionInterface::PLUGIN_FORM_KEY
*/
public array $forms = [];
/**
* Constructs an Action attribute.
*
* @param string $id
* The plugin ID.
* @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $label
* The label of the action.
* @param string[] $forms
* A list of optional form classes implementing PluginFormInterface.
* @param string[] $required_states
* States required to exist.
*/
public function __construct(string $id, ?TranslatableMarkup $label = NULL, array $forms = [], array $required_states = []) {
$this->forms = $forms;
$this->required_states = $required_states;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
WorkflowType::$forms | public | property | A list of optional form classes implementing PluginFormInterface. |
WorkflowType::$required_states | public | property | States required to exist. |
WorkflowType::__construct | public | function | Constructs an Action attribute. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.