c2c88ddcdae06287b6f75d1c35ccd19c336519a6
[yaffs-website] / web / core / modules / workflows / tests / modules / workflow_type_test / src / Plugin / WorkflowType / RequiredStateTestType.php
1 <?php
2
3 namespace Drupal\workflow_type_test\Plugin\WorkflowType;
4
5 use Drupal\Core\StringTranslation\StringTranslationTrait;
6 use Drupal\workflows\Plugin\WorkflowTypeBase;
7
8 /**
9  * Test workflow type.
10  *
11  * @WorkflowType(
12  *   id = "workflow_type_required_state_test",
13  *   label = @Translation("Required State Type Test"),
14  *   required_states = {
15  *     "fresh",
16  *     "rotten",
17  *   }
18  * )
19  */
20 class RequiredStateTestType extends WorkflowTypeBase {
21
22   use StringTranslationTrait;
23
24   /**
25    * {@inheritdoc}
26    */
27   public function defaultConfiguration() {
28     return [
29       'states' => [
30         'fresh' => [
31           'label' => 'Fresh',
32           'weight' => 0,
33         ],
34         'rotten' => [
35           'label' => 'Rotten',
36           'weight' => 1,
37         ],
38       ],
39       'transitions' => [
40         'rot' => [
41           'label' => 'Rot',
42           'to' => 'rotten',
43           'weight' => 0,
44           'from' => [
45             'fresh',
46           ],
47         ],
48       ],
49     ];
50   }
51
52 }