You are here

public static function WorkflowState::load in Workflow 7.2

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

Alternative constructor, loading objects from table {workflow_states}.

Parameters

int $sid: The requested State ID

int $wid: An optional Workflow ID, to check if the requested State is valid for the Workflow.

Return value

WorkflowState|NULL|FALSE $state WorkflowState if state is successfully loaded, NULL if not loaded, FALSE if state does not belong to requested Workflow.

2 calls to WorkflowState::load()
workflow_state_load in ./workflow.entity.inc
CRUD for WorkflowState.
workflow_state_load_single in ./workflow.entity.inc

File

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

Class

WorkflowState
Class WorkflowState

Code

public static function load($sid, $wid = 0) {
  $states = self::getStates();
  $state = isset($states[$sid]) ? $states[$sid] : NULL;
  if ($wid && $state && $wid != $state->wid) {
    return FALSE;
  }
  return $state;
}