. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Elements; use Fisharebest\Webtrees\Tree; /** * SOUR:DATA is an empty element with children; EVEN, AGNC and NOTE. */ class SourceData extends EmptyElement { protected const SUBTAGS = [ 'DATE' => '0:1', 'TEXT' => '0:M', ]; protected const ABRIDGED_SUBTAGS = [ 'TEXT' => '0:M', ]; /** * @param Tree $tree * * @return array */ public function subtags(Tree $tree): array { if ($tree->getPreference('FULL_SOURCES') === '1') { return static::SUBTAGS; } return static::ABRIDGED_SUBTAGS; } }