You are here

class SchedulerModerationConstraint in Scheduler content moderation integration 8

Validates publish on values.

Plugin annotation


@Constraint(
  id = "SchedulerModeration",
  label = @Translation("Scheduler publish state transition validation", context = "Validation"),
  type = "entity:node"
)

Hierarchy

Expanded class hierarchy of SchedulerModerationConstraint

File

src/Plugin/Validation/Constraint/SchedulerModerationConstraint.php, line 16

Namespace

Drupal\scheduler_content_moderation_integration\Plugin\Validation\Constraint
View source
class SchedulerModerationConstraint extends CompositeConstraintBase {

  /**
   * Message for invalid publishing/un-publishing to a moderation state.
   *
   * @var string
   */
  public $messagePublishModerationInvalid = "Invalid moderation transition, adjust the node's current state.";

  /**
   * {@inheritdoc}
   */
  public function coversFields() {
    return [
      'publish_state',
      'unpublish_state',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SchedulerModerationConstraint::$messagePublishModerationInvalid public property Message for invalid publishing/un-publishing to a moderation state.
SchedulerModerationConstraint::coversFields public function An array of entity fields which should be passed to the validator. Overrides CompositeConstraintBase::coversFields