xref: /webtrees/app/Contracts/FamilyFactoryInterface.php (revision bb03c9f048b83092098d5e46c2ab323ae7e2b314)
1*bb03c9f0SGreg Roach<?php
2*bb03c9f0SGreg Roach
3*bb03c9f0SGreg Roach/**
4*bb03c9f0SGreg Roach * webtrees: online genealogy
5*bb03c9f0SGreg Roach * Copyright (C) 2019 webtrees development team
6*bb03c9f0SGreg Roach * This program is free software: you can redistribute it and/or modify
7*bb03c9f0SGreg Roach * it under the terms of the GNU General Public License as published by
8*bb03c9f0SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9*bb03c9f0SGreg Roach * (at your option) any later version.
10*bb03c9f0SGreg Roach * This program is distributed in the hope that it will be useful,
11*bb03c9f0SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12*bb03c9f0SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13*bb03c9f0SGreg Roach * GNU General Public License for more details.
14*bb03c9f0SGreg Roach * You should have received a copy of the GNU General Public License
15*bb03c9f0SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
16*bb03c9f0SGreg Roach */
17*bb03c9f0SGreg Roach
18*bb03c9f0SGreg Roachdeclare(strict_types=1);
19*bb03c9f0SGreg Roach
20*bb03c9f0SGreg Roachnamespace Fisharebest\Webtrees\Contracts;
21*bb03c9f0SGreg Roach
22*bb03c9f0SGreg Roachuse Closure;
23*bb03c9f0SGreg Roachuse Fisharebest\Webtrees\Family;
24*bb03c9f0SGreg Roachuse Fisharebest\Webtrees\Tree;
25*bb03c9f0SGreg Roach
26*bb03c9f0SGreg Roach/**
27*bb03c9f0SGreg Roach * Make a Family object.
28*bb03c9f0SGreg Roach */
29*bb03c9f0SGreg Roachinterface FamilyFactoryInterface
30*bb03c9f0SGreg Roach{
31*bb03c9f0SGreg Roach    public function make(string $xref, Tree $tree, string $gedcom = null): ?Family;
32*bb03c9f0SGreg Roach
33*bb03c9f0SGreg Roach    /**
34*bb03c9f0SGreg Roach     * Create a Family object from a row in the database.
35*bb03c9f0SGreg Roach     *
36*bb03c9f0SGreg Roach     * @param Tree $tree
37*bb03c9f0SGreg Roach     *
38*bb03c9f0SGreg Roach     * @return Closure
39*bb03c9f0SGreg Roach     */
40*bb03c9f0SGreg Roach    public function mapper(Tree $tree): Closure;
41*bb03c9f0SGreg Roach
42*bb03c9f0SGreg Roach    /**
43*bb03c9f0SGreg Roach     * Create a Family object from raw GEDCOM data.
44*bb03c9f0SGreg Roach     *
45*bb03c9f0SGreg Roach     * @param string      $xref
46*bb03c9f0SGreg Roach     * @param string      $gedcom  an empty string for new/pending records
47*bb03c9f0SGreg Roach     * @param string|null $pending null for a record with no pending edits,
48*bb03c9f0SGreg Roach     *                             empty string for records with pending deletions
49*bb03c9f0SGreg Roach     * @param Tree        $tree
50*bb03c9f0SGreg Roach     *
51*bb03c9f0SGreg Roach     * @return Family
52*bb03c9f0SGreg Roach     */
53*bb03c9f0SGreg Roach    public function new(string $xref, string $gedcom, ?string $pending, Tree $tree): Family;
54*bb03c9f0SGreg Roach}
55