generate:plugin:validationconstraint

Generate a validation constraint plugin.

Usage:

drupal generate:plugin:validationconstraint  [options]
gpvc

Available options

OptionDetails

--module

The Module name.

--class

Plugin class name

--label

Plugin label

--plugin-id

Plugin id

--hook

Generate hook to validate a field

--field-id

Field id

--bundle

Bundle

Examples

Generate a validation constraint plugin specifying the module name, the class, its label, the plugin id, the entity bundle and the field id

drupal generate:plugin:validationconstraint  \
  --module="modulename" \
  --class="ExampleConstraint" \
  --label="Example validation constraint" \
  -plugin-id="example_validation_constraint" \
  --hook \
  --field-id="field_exmaple_id" \
  --bundle="entity_example_bundle" \
  --no-interaction