. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; use Fisharebest\Webtrees\I18N; use function strtoupper; /** * MARR:TYPE */ class MarriageType extends AbstractElement { public const VALUE_CIVIL = 'CIVIL'; public const VALUE_PARTNERS = 'PARTNERS'; public const VALUE_RELIGIOUS = 'RELIGIOUS'; /** * Convert a value to a canonical form. * GEDCOM 5.5EL uses 'RELI' and 'CIVIL' * * @param string $value * * @return string */ public function canonical(string $value): string { $value = strtoupper(parent::canonical($value)); $canonical = [ 'RELI' => 'RELIGIOUS' ]; return $canonical[$value] ?? $value; } /** * A list of controlled values for this element. * * @return array */ public function values(): array { return [ '' => '', self::VALUE_CIVIL => I18N::translate('Civil marriage'), self::VALUE_PARTNERS => I18N::translate('Registered partnership'), self::VALUE_RELIGIOUS => I18N::translate('Religious marriage'), ]; } }