You are here

public function WorkflowCustomAccessType::defaultConfiguration in Drupal 10

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

Gets default configuration for this plugin.

Return value

array An associative array with the default configuration.

Overrides WorkflowTypeBase::defaultConfiguration

File

core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/WorkflowCustomAccessType.php, line 23

Class

WorkflowCustomAccessType
A test workflow with custom state/transition access rules applied.

Namespace

Drupal\workflow_type_test\Plugin\WorkflowType

Code

public function defaultConfiguration() {
  return [
    'states' => [
      'cannot_update' => [
        'label' => 'Cannot Update State',
        'weight' => 0,
      ],
      'cannot_delete' => [
        'label' => 'Cannot Delete State',
        'weight' => 0,
      ],
    ],
    'transitions' => [
      'cannot_update' => [
        'label' => 'Cannot Update Transition',
        'to' => 'cannot_update',
        'weight' => 0,
        'from' => [
          'cannot_update',
        ],
      ],
      'cannot_delete' => [
        'label' => 'Cannot Delete Transition',
        'to' => 'cannot_delete',
        'weight' => 1,
        'from' => [
          'cannot_delete',
        ],
      ],
    ],
  ];
}