Version 1
[yaffs-website] / web / core / modules / aggregator / src / Plugin / Validation / Constraint / FeedTitleConstraint.php
diff --git a/web/core/modules/aggregator/src/Plugin/Validation/Constraint/FeedTitleConstraint.php b/web/core/modules/aggregator/src/Plugin/Validation/Constraint/FeedTitleConstraint.php
new file mode 100644 (file)
index 0000000..e6953da
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+namespace Drupal\aggregator\Plugin\Validation\Constraint;
+
+use Drupal\Core\Validation\Plugin\Validation\Constraint\UniqueFieldConstraint;
+
+/**
+ * Supports validating feed titles.
+ *
+ * @Constraint(
+ *   id = "FeedTitle",
+ *   label = @Translation("Feed title", context = "Validation")
+ * )
+ */
+class FeedTitleConstraint extends UniqueFieldConstraint {
+
+  public $message = 'A feed named %value already exists. Enter a unique title.';
+
+}