Same name and namespace in other branches
  1. 8.9.x core/modules/workflows/src/Annotation/WorkflowType.php \Drupal\workflows\Annotation\WorkflowType
  2. 9 core/modules/workflows/src/Annotation/WorkflowType.php \Drupal\workflows\Annotation\WorkflowType

Defines a Workflow type annotation object.

Plugin Namespace: Plugin\WorkflowType

For a working example, see \Drupal\content_moderation\Plugin\Workflow\ContentModerate

Hierarchy

Expanded class hierarchy of WorkflowType

See also

\Drupal\workflows\WorkflowTypeInterface

\Drupal\workflows\WorkflowTypeManager

workflow_type_info_alter()

Plugin API

Related topics

File

core/modules/workflows/src/Annotation/WorkflowType.php, line 21

Namespace

Drupal\workflows\Annotation
View source
class WorkflowType extends Plugin {

  /**
   * The plugin ID.
   *
   * @var string
   */
  public $id;

  /**
   * The label of the workflow.
   *
   * @var \Drupal\Core\Annotation\Translation
   *
   * @ingroup plugin_translatable
   */
  public $label = '';

  /**
   * States required to exist.
   *
   * Normally supplied by WorkflowType::defaultConfiguration().
   *
   * @var array
   */
  public $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
   *
   * @var array
   */
  public $forms = [];

}

Members

Namesort descending Modifiers Type Description Overrides
Plugin::$definition protected property The plugin definition read from the class annotation. 1
Plugin::get public function Gets the value of an annotation. Overrides AnnotationInterface::get 6
Plugin::getClass public function Gets the class of the annotated class. Overrides AnnotationInterface::getClass 1
Plugin::getId public function Gets the unique ID for this annotated class. Overrides AnnotationInterface::getId
Plugin::getProvider public function Gets the name of the provider of the annotated class. Overrides AnnotationInterface::getProvider 1
Plugin::parse protected function Parses an annotation into its definition.
Plugin::setClass public function Sets the class of the annotated class. Overrides AnnotationInterface::setClass 1
Plugin::setProvider public function Sets the name of the provider of the annotated class. Overrides AnnotationInterface::setProvider
Plugin::__construct public function Constructs a Plugin object. 3
WorkflowType::$forms public property A list of optional form classes implementing PluginFormInterface.
WorkflowType::$id public property The plugin ID.
WorkflowType::$label public property The label of the workflow.
WorkflowType::$required_states public property States required to exist.