You are here

class ValidDynamicReferenceConstraint in Dynamic Entity Reference 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Validation/Constraint/ValidDynamicReferenceConstraint.php \Drupal\dynamic_entity_reference\Plugin\Validation\Constraint\ValidDynamicReferenceConstraint

Dynamic Entity Reference valid reference constraint.

Verifies that referenced entities are valid.

Plugin annotation


@Constraint(
  id = "ValidDynamicReference",
  label = @Translation("Dynamic Entity Reference valid reference", context = "Validation")
)

Hierarchy

Expanded class hierarchy of ValidDynamicReferenceConstraint

File

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

Namespace

Drupal\dynamic_entity_reference\Plugin\Validation\Constraint
View source
class ValidDynamicReferenceConstraint extends Constraint {

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = 'This entity (%type: %id) cannot be referenced.';

  /**
   * Violation message when the entity does not exist.
   *
   * @var string
   */
  public $nonExistingMessage = 'The referenced entity (%type: %id) does not exist.';

  /**
   * Violation message when a new entity ("autocreate") is invalid.
   *
   * @var string
   */
  public $invalidAutocreateMessage = 'This entity (%type: %label) cannot be referenced.';

  /**
   * The default violation message.
   *
   * @var string
   */
  public $wrongIDMessage = 'The referenced entity (%type: %id) does not exist.';

  /**
   * Validation message when the entity type is not supported.
   *
   * @var string
   */
  public $wrongTypeMessage = 'The referenced entity type (%type) is not allowed for this field.';

  /**
   * Validation message when bundle is not supported.
   *
   * @var string
   */
  public $wrongBundleMessage = 'Referenced entity %label does not belong to one of the supported bundles (%bundles).';

  /**
   * Validate message if no bundle is allowed.
   *
   * @var string
   */
  public $noBundleAllowed = 'No bundle is allowed for (%type)';

  /**
   * Validation message when the target_id or target_type is empty.
   *
   * @var string
   */
  public $nullMessage = '%property should not be null.';

}

Members

Namesort descending Modifiers Type Description Overrides
ValidDynamicReferenceConstraint::$invalidAutocreateMessage public property Violation message when a new entity ("autocreate") is invalid.
ValidDynamicReferenceConstraint::$message public property The default violation message.
ValidDynamicReferenceConstraint::$noBundleAllowed public property Validate message if no bundle is allowed.
ValidDynamicReferenceConstraint::$nonExistingMessage public property Violation message when the entity does not exist.
ValidDynamicReferenceConstraint::$nullMessage public property Validation message when the target_id or target_type is empty.
ValidDynamicReferenceConstraint::$wrongBundleMessage public property Validation message when bundle is not supported.
ValidDynamicReferenceConstraint::$wrongIDMessage public property The default violation message.
ValidDynamicReferenceConstraint::$wrongTypeMessage public property Validation message when the entity type is not supported.