Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Entity / Plugin / Validation / Constraint / ReferenceAccessConstraint.php
diff --git a/web/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ReferenceAccessConstraint.php b/web/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ReferenceAccessConstraint.php
new file mode 100644 (file)
index 0000000..c8976b8
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+namespace Drupal\Core\Entity\Plugin\Validation\Constraint;
+
+use Symfony\Component\Validator\Constraint;
+
+/**
+ * Entity Reference valid reference constraint.
+ *
+ * Verifies that referenced entities are valid.
+ *
+ * @Constraint(
+ *   id = "ReferenceAccess",
+ *   label = @Translation("Entity Reference reference access", context = "Validation")
+ * )
+ */
+class ReferenceAccessConstraint extends Constraint {
+
+  /**
+   * The default violation message.
+   *
+   * @var string
+   */
+  public $message = 'You do not have access to the referenced entity (%type: %id).';
+
+}