class WorkflowType
Same name in this branch
- 10 core/modules/workflows/src/Annotation/WorkflowType.php \Drupal\workflows\Annotation\WorkflowType
Same name and namespace 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
Hierarchy
- class \Drupal\Component\Plugin\Attribute\AttributeBase implements \Drupal\Component\Plugin\Attribute\AttributeInterface
- class \Drupal\Component\Plugin\Attribute\Plugin extends \Drupal\Component\Plugin\Attribute\AttributeBase
- class \Drupal\workflows\Attribute\WorkflowType extends \Drupal\Component\Plugin\Attribute\Plugin
- class \Drupal\Component\Plugin\Attribute\Plugin extends \Drupal\Component\Plugin\Attribute\AttributeBase
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 | Overriden Title | Overrides |
---|---|---|---|---|---|
AttributeBase::$class | protected | property | The class used for this attribute class. | ||
AttributeBase::$provider | protected | property | The provider of the attribute class. | ||
AttributeBase::get | public | function | Gets the value of an attribute. | Overrides AttributeInterface::get | 2 |
AttributeBase::getClass | public | function | Gets the class of the attribute class. | Overrides AttributeInterface::getClass | |
AttributeBase::getId | public | function | Gets the unique ID for this attribute class. | Overrides AttributeInterface::getId | |
AttributeBase::getProvider | public | function | Gets the name of the provider of the attribute class. | Overrides AttributeInterface::getProvider | |
AttributeBase::setClass | public | function | Sets the class of the attributed class. | Overrides AttributeInterface::setClass | |
AttributeBase::setProvider | public | function | Sets the name of the provider of the attribute class. | Overrides AttributeInterface::setProvider | |
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. | Overrides Plugin::__construct |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.