You are here

class ValidHierarchyReferenceConstraint in Entity Reference Hierarchy 8.2

Same name and namespace in other branches
  1. 3.x src/Plugin/Validation/Constraint/ValidHierarchyReferenceConstraint.php \Drupal\entity_hierarchy\Plugin\Validation\Constraint\ValidHierarchyReferenceConstraint

Entity Reference valid reference constraint.

Verifies that referenced entities are valid.

Plugin annotation


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

Hierarchy

Expanded class hierarchy of ValidHierarchyReferenceConstraint

File

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

Namespace

Drupal\entity_hierarchy\Plugin\Validation\Constraint
View source
class ValidHierarchyReferenceConstraint extends Constraint {

  /**
   * The default violation message.
   *
   * @var string
   */
  public $message = 'This entity (%type: %id) cannot be referenced as it is either a child or the same entity.';

}

Members

Namesort descending Modifiers Type Description Overrides
ValidHierarchyReferenceConstraint::$message public property The default violation message.