You are here

public function PredefinedStatesWorkflowTestType::hasState in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/PredefinedStatesWorkflowTestType.php \Drupal\workflow_type_test\Plugin\WorkflowType\PredefinedStatesWorkflowTestType::hasState()
  2. 9 core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/PredefinedStatesWorkflowTestType.php \Drupal\workflow_type_test\Plugin\WorkflowType\PredefinedStatesWorkflowTestType::hasState()

Determines if the workflow has a state with the provided ID.

Parameters

string $state_id: The state's ID.

Return value

bool TRUE if the workflow has a state with the provided ID, FALSE if not.

Overrides WorkflowTypeBase::hasState

File

core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/PredefinedStatesWorkflowTestType.php, line 52

Class

PredefinedStatesWorkflowTestType
Test workflow type.

Namespace

Drupal\workflow_type_test\Plugin\WorkflowType

Code

public function hasState($state_id) {
  $states = $this
    ->getStates();
  return isset($states[$state_id]);
}