Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContentModerationState.php

function ContentModerationState::__construct

ContentModerationState constructor.

Decorates state objects to add methods to determine if an entity should be published or made the default revision.

Parameters

\Drupal\workflows\StateInterface $state: The vanilla state object from the Workflow module.

bool $published: (optional) TRUE if entities should be published if in this state, FALSE if not. Defaults to FALSE.

bool $default_revision: (optional) TRUE if entities should be the default revision if in this state, FALSE if not. Defaults to FALSE.

File

core/modules/content_moderation/src/ContentModerationState.php, line 48

Class

ContentModerationState
A value object representing a workflow state for content moderation.

Namespace

Drupal\content_moderation

Code

public function __construct(StateInterface $state, $published = FALSE, $default_revision = FALSE) {
    $this->state = $state;
    $this->published = $published;
    $this->defaultRevision = $default_revision;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal