. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; use Fisharebest\Webtrees\I18N; use function strtoupper; /** * MARR:TYPE */ class MarriageType extends AbstractElement { public const string VALUE_CIVIL = 'CIVIL'; public const string VALUE_COMMON_LAW = 'COMMON LAW'; public const string VALUE_PARTNERS = 'PARTNERS'; public const string VALUE_RELIGIOUS = 'RELIGIOUS'; /** * Convert a value to a canonical form. * GEDCOM 5.5EL uses 'RELI' for 'Religious marriage' (RELIGIOUS) */ public function canonical(string $value): string { $value = strtoupper(parent::canonical($value)); $canonical = [ 'RELI' => self::VALUE_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_COMMON_LAW => I18N::translate('Common-law marriage'), self::VALUE_PARTNERS => I18N::translate('Registered partnership'), self::VALUE_RELIGIOUS => I18N::translate('Religious marriage'), ]; } }