function ContentModeration::defaultConfiguration

Same name and namespace in other branches
  1. 8.9.x core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration::defaultConfiguration()
  2. 10 core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration::defaultConfiguration()
  3. 11.x core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php \Drupal\content_moderation\Plugin\WorkflowType\ContentModeration::defaultConfiguration()

Overrides WorkflowTypeBase::defaultConfiguration

File

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

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' => [],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.