You are here

class ModerationState in Workbench Moderation 8

Same name in this branch
  1. 8 src/Entity/ModerationState.php \Drupal\workbench_moderation\Entity\ModerationState
  2. 8 src/Plugin/Validation/Constraint/ModerationState.php \Drupal\workbench_moderation\Plugin\Validation\Constraint\ModerationState
Same name and namespace in other branches
  1. 8.2 src/Plugin/Validation/Constraint/ModerationState.php \Drupal\workbench_moderation\Plugin\Validation\Constraint\ModerationState

Dynamic Entity Reference valid reference constraint.

Verifies that nodes have a valid moderation state.

Plugin annotation


@Constraint(
  id = "ModerationState",
  label = @Translation("Valid moderation state", context = "Validation")
)

Hierarchy

  • class \Drupal\workbench_moderation\Plugin\Validation\Constraint\ModerationState extends \Symfony\Component\Validator\Constraint

Expanded class hierarchy of ModerationState

1 string reference to 'ModerationState'
EntityTypeInfo::entityBundleFieldInfoAlter in src/EntityTypeInfo.php
Force moderatable bundles to have a moderation_state field.

File

src/Plugin/Validation/Constraint/ModerationState.php, line 17

Namespace

Drupal\workbench_moderation\Plugin\Validation\Constraint
View source
class ModerationState extends Constraint {

  /**
   * {@inheritdoc}
   */
  public $message = 'Invalid state transition from %from to %to';

  /**
   * {@inheritdoc}
   */
  public $accessDeniedMessage = 'You do not have access to transition from %from to %to';

}

Members