function ContentModeration::addEntityTypeAndBundle

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

Overrides ContentModerationInterface::addEntityTypeAndBundle

File

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

Class

ContentModeration
Attaches workflows to content entity types and their bundles.

Namespace

Drupal\content_moderation\Plugin\WorkflowType

Code

public function addEntityTypeAndBundle($entity_type_id, $bundle_id) {
    if (!$this->appliesToEntityTypeAndBundle($entity_type_id, $bundle_id)) {
        $this->configuration['entity_types'][$entity_type_id][] = $bundle_id;
        sort($this->configuration['entity_types'][$entity_type_id]);
        ksort($this->configuration['entity_types']);
    }
}

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