summaryrefslogtreecommitdiff
path: root/app/Elements/Form.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2021-04-06 09:46:34 +0100
committerGreg Roach <fisharebest@gmail.com>2021-04-06 09:46:34 +0100
commitcf9d80bba1ec3aa8aa5b3a9bde6528b2fdbefe5d (patch)
treea77a8b14fef783977b1fab4fc2dffa741fbb8906 /app/Elements/Form.php
parent7f85bc3751be8b3a965a91c738eb2b1a2554007e (diff)
downloadwebtrees-cf9d80bba1ec3aa8aa5b3a9bde6528b2fdbefe5d.tar.gz
webtrees-cf9d80bba1ec3aa8aa5b3a9bde6528b2fdbefe5d.tar.bz2
webtrees-cf9d80bba1ec3aa8aa5b3a9bde6528b2fdbefe5d.zip
Prefer LINEAGE-LINKED to Lineage-Linked
Diffstat (limited to 'app/Elements/Form.php')
-rw-r--r--app/Elements/Form.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/Elements/Form.php b/app/Elements/Form.php
index ea2024f1f5..df6600eeec 100644
--- a/app/Elements/Form.php
+++ b/app/Elements/Form.php
@@ -19,6 +19,7 @@ declare(strict_types=1);
namespace Fisharebest\Webtrees\Elements;
+use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Tree;
/**
@@ -34,6 +35,18 @@ class Form extends AbstractElement
protected const MAXIMUM_LENGTH = 20;
/**
+ * Convert a value to a canonical form.
+ *
+ * @param string $value
+ *
+ * @return string
+ */
+ public function canonical(string $value): string
+ {
+ return strtoupper(parent::canonical($value));
+ }
+
+ /**
* Create a default value for this element.
*
* @param Tree $tree
@@ -44,4 +57,16 @@ class Form extends AbstractElement
{
return 'LINEAGE-LINKED';
}
+
+ /**
+ * A list of controlled values for this element
+ *
+ * @return array<int|string,string>
+ */
+ public function values(): array
+ {
+ return [
+ 'LINEAGE-LINKED' => 'LINEAGE-LINKED',
+ ];
+ }
}