You are here

public function ContentModerationState::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/src/ContentModerationState.php \Drupal\content_moderation\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;
}