You are here

function hook_workflow_comment_alter in Workflow 8

Same name and namespace in other branches
  1. 7.2 workflow.api.php \hook_workflow_comment_alter()

Implements hook_workflow_comment_alter().

Allow other modules to change the user comment when saving a state change.

Parameters

string $comment: The comment of the current state transition.

array $context: 'transition' - The current transition itself.

1 call to hook_workflow_comment_alter()
workflow_devel_workflow_comment_alter in modules/workflow_devel/workflow_devel.module
@inheritdoc
1 function implements hook_workflow_comment_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

workflow_devel_workflow_comment_alter in modules/workflow_devel/workflow_devel.module
@inheritdoc
1 invocation of hook_workflow_comment_alter()
WorkflowTransition::execute in src/Entity/WorkflowTransition.php
Execute a transition (change state of an entity).

File

./workflow.api.php, line 188
Hooks provided by the workflow module.

Code

function hook_workflow_comment_alter(&$comment, array &$context) {

  // workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', '');

  /** @var \Drupal\workflow\Entity\WorkflowTransitionInterface $transition */
  $transition = $context['transition'];

  //$comment = $transition->getOwner()->getUsername() . ' says: ' . $comment;
}