Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / lib / Drupal / Core / Entity / Plugin / Validation / Constraint / EntityUntranslatableFieldsConstraint.php
diff --git a/web/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityUntranslatableFieldsConstraint.php b/web/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityUntranslatableFieldsConstraint.php
new file mode 100644 (file)
index 0000000..bb1a924
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+namespace Drupal\Core\Entity\Plugin\Validation\Constraint;
+
+use Symfony\Component\Validator\Constraint;
+
+/**
+ * Validation constraint for the entity changed timestamp.
+ *
+ * @Constraint(
+ *   id = "EntityUntranslatableFields",
+ *   label = @Translation("Entity untranslatable fields", context = "Validation"),
+ *   type = {"entity"}
+ * )
+ */
+class EntityUntranslatableFieldsConstraint extends Constraint {
+
+  public $defaultRevisionMessage = 'Non-translatable fields can only be changed when updating the current revision.';
+  public $defaultTranslationMessage = 'Non-translatable fields can only be changed when updating the original language.';
+
+}