You are here

public function Workflow::getState in Workflow 7.2

Same name and namespace in other branches
  1. 7 includes/Entity/Workflow.php \Workflow::getState()

Gets a state for a given workflow.

Parameters

mixed $key: A state ID or state Name.

Return value

WorkflowState A WorkflowState object.

Overrides WorkflowInterface::getState

2 calls to Workflow::getState()
Workflow::getCreationState in includes/Entity/Workflow.php
Gets the initial state for a newly created entity.
Workflow::rebuildInternals in includes/Entity/Workflow.php
Rebuild internals that get saved separately.

File

includes/Entity/Workflow.php, line 502
Contains workflow\includes\Entity\Workflow. Contains workflow\includes\Entity\WorkflowController.

Class

Workflow

Code

public function getState($key) {
  if (is_numeric($key)) {
    return workflow_state_load_single($key, $this->wid);
  }
  else {
    return workflow_state_load_by_name($key, $this->wid);
  }
}