You are here

public function ContentModeration::defaultConfiguration in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration::defaultConfiguration()

Gets default configuration for this plugin.

Return value

array An associative array with the default configuration.

Overrides WorkflowTypeBase::defaultConfiguration

File

core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php, line 191

Class

ContentModeration
Attaches workflows to content entity types and their bundles.

Namespace

Drupal\content_moderation\Plugin\WorkflowType

Code

public function defaultConfiguration() {
  return [
    'states' => [
      'draft' => [
        'label' => 'Draft',
        'published' => FALSE,
        'default_revision' => FALSE,
        'weight' => 0,
      ],
      'published' => [
        'label' => 'Published',
        'published' => TRUE,
        'default_revision' => TRUE,
        'weight' => 1,
      ],
    ],
    'transitions' => [
      'create_new_draft' => [
        'label' => 'Create New Draft',
        'to' => 'draft',
        'weight' => 0,
        'from' => [
          'draft',
          'published',
        ],
      ],
      'publish' => [
        'label' => 'Publish',
        'to' => 'published',
        'weight' => 1,
        'from' => [
          'draft',
          'published',
        ],
      ],
    ],
    'entity_types' => [],
  ];
}