RequiredStateTestType.php in Drupal 8
File
core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/RequiredStateTestType.php
View source
<?php
namespace Drupal\workflow_type_test\Plugin\WorkflowType;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\workflows\Plugin\WorkflowTypeBase;
class RequiredStateTestType extends WorkflowTypeBase {
use StringTranslationTrait;
public function defaultConfiguration() {
return [
'states' => [
'fresh' => [
'label' => 'Fresh',
'weight' => 0,
],
'rotten' => [
'label' => 'Rotten',
'weight' => 1,
],
],
'transitions' => [
'rot' => [
'label' => 'Rot',
'to' => 'rotten',
'weight' => 0,
'from' => [
'fresh',
],
],
],
];
}
}