Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / content_moderation / src / StateTransitionValidationInterface.php
index 1acbf052fd064607aa015bfa94a7fcab83d9564c..c793fe53e275309ae53d60557a3d1e94c7bce525 100644 (file)
@@ -4,6 +4,8 @@ namespace Drupal\content_moderation;
 
 use Drupal\Core\Entity\ContentEntityInterface;
 use Drupal\Core\Session\AccountInterface;
+use Drupal\workflows\StateInterface;
+use Drupal\workflows\WorkflowInterface;
 
 /**
  * Validates whether a certain state transition is allowed.
@@ -23,4 +25,21 @@ interface StateTransitionValidationInterface {
    */
   public function getValidTransitions(ContentEntityInterface $entity, AccountInterface $user);
 
+  /**
+   * Checks if a transition between two states if valid for the given user.
+   *
+   * @param \Drupal\workflows\WorkflowInterface $workflow
+   *   The workflow entity.
+   * @param \Drupal\workflows\StateInterface $original_state
+   *   The original workflow state.
+   * @param \Drupal\workflows\StateInterface $new_state
+   *   The new workflow state.
+   * @param \Drupal\Core\Session\AccountInterface $user
+   *   The user to validate.
+   *
+   * @return bool
+   *   Returns TRUE if transition is valid, otherwise FALSE.
+   */
+  public function isTransitionValid(WorkflowInterface $workflow, StateInterface $original_state, StateInterface $new_state, AccountInterface $user);
+
 }