You are here

interface WorkflowConfigTransitionInterface in Workflow 8

Defines a common interface for Workflow*Transition* objects.

Hierarchy

Expanded class hierarchy of WorkflowConfigTransitionInterface

All classes that implement WorkflowConfigTransitionInterface

See also

\Drupal\workflow\Entity\WorkflowConfigTransition

\Drupal\workflow\Entity\WorkflowTransition

\Drupal\workflow\Entity\WorkflowScheduledTransition

File

src/Entity/WorkflowConfigTransitionInterface.php, line 14

Namespace

Drupal\workflow\Entity
View source
interface WorkflowConfigTransitionInterface {

  /**
   * Determines if the current transition between 2 states is allowed.
   *
   * This is checked in the following locations:
   * - in settings;
   * - in permissions;
   * - by permission hooks, implemented by other modules.
   *
   * @param \Drupal\user\UserInterface $user
   *   The user to act upon.
   *   May have the custom WORKFLOW_ROLE_AUTHOR_RID role.
   * @param bool $force
   *   Indicates if the transition must be forced(E.g., by cron, rules).
   *
   * @return bool
   *   TRUE if OK, else FALSE.
   */
  public function isAllowed(UserInterface $user, $force = FALSE);

  /**
   * Returns the Workflow object of this object.
   *
   * @return Workflow
   *   Workflow object.
   */
  public function getWorkflow();

  /**
   * Returns the Workflow ID of this object.
   *
   * @return string
   *   Workflow ID.
   */
  public function getWorkflowId();

  /**
   * @return WorkflowState
   */
  public function getFromState();

  /**
   * @return WorkflowState
   */
  public function getToState();

  /**
   * @return string
   */
  public function getFromSid();

  /**
   * @return string
   */
  public function getToSid();

  /**
   * Determines if the State changes by this Transition.
   *
   * @return bool
   */
  public function hasStateChange();

}

Members

Namesort descending Modifiers Type Description Overrides
WorkflowConfigTransitionInterface::getFromSid public function 2
WorkflowConfigTransitionInterface::getFromState public function 2
WorkflowConfigTransitionInterface::getToSid public function 2
WorkflowConfigTransitionInterface::getToState public function 2
WorkflowConfigTransitionInterface::getWorkflow public function Returns the Workflow object of this object.
WorkflowConfigTransitionInterface::getWorkflowId public function Returns the Workflow ID of this object.
WorkflowConfigTransitionInterface::hasStateChange public function Determines if the State changes by this Transition. 2
WorkflowConfigTransitionInterface::isAllowed public function Determines if the current transition between 2 states is allowed. 2