You are here

public static function WorkflowState::loadByName in Workflow 7.2

Get all states in the system, with options to filter, only where a workflow exists.

May return more then one State, since a name is not (yet) an UUID.

Parameters

$name:

int $wid:

Return value

WorkflowState

1 call to WorkflowState::loadByName()
workflow_state_load_by_name in ./workflow.entity.inc

File

includes/Entity/WorkflowState.php, line 153
Contains workflow\includes\Entity\WorkflowState. Contains workflow\includes\Entity\WorkflowStateController.

Class

WorkflowState
Class WorkflowState

Code

public static function loadByName($name, $wid = 0) {

  /* @var $state WorkflowState */
  foreach ($states = self::getStates($wid) as $state) {
    if ($name == $state->name) {
      return $state;
    }
  }
  return NULL;
}