xref: /webtrees/app/Family.php (revision 76692c8b291f16d9251d67f27078779f6737fe7e)
1a25f0a04SGreg Roach<?php
2a25f0a04SGreg Roach/**
3a25f0a04SGreg Roach * webtrees: online genealogy
4a25f0a04SGreg Roach * Copyright (C) 2015 webtrees development team
5a25f0a04SGreg Roach * This program is free software: you can redistribute it and/or modify
6a25f0a04SGreg Roach * it under the terms of the GNU General Public License as published by
7a25f0a04SGreg Roach * the Free Software Foundation, either version 3 of the License, or
8a25f0a04SGreg Roach * (at your option) any later version.
9a25f0a04SGreg Roach * This program is distributed in the hope that it will be useful,
10a25f0a04SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
11a25f0a04SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12a25f0a04SGreg Roach * GNU General Public License for more details.
13a25f0a04SGreg Roach * You should have received a copy of the GNU General Public License
14a25f0a04SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
15a25f0a04SGreg Roach */
16*76692c8bSGreg Roachnamespace Fisharebest\Webtrees;
17a25f0a04SGreg Roach
18a25f0a04SGreg Roach/**
19*76692c8bSGreg Roach * A GEDCOM family (FAM) object.
20a25f0a04SGreg Roach */
21a25f0a04SGreg Roachclass Family extends GedcomRecord {
22a25f0a04SGreg Roach	const RECORD_TYPE = 'FAM';
23a25f0a04SGreg Roach	const URL_PREFIX  = 'family.php?famid=';
24a25f0a04SGreg Roach
25a25f0a04SGreg Roach	/** @var Individual|null The husband (or first spouse for same-sex couples) */
26a25f0a04SGreg Roach	private $husb;
27a25f0a04SGreg Roach
28a25f0a04SGreg Roach	/** @var Individual|null The wife (or second spouse for same-sex couples) */
29a25f0a04SGreg Roach	private $wife;
30a25f0a04SGreg Roach
31*76692c8bSGreg Roach	/**
32*76692c8bSGreg Roach	 * Create a GedcomRecord object from raw GEDCOM data.
33*76692c8bSGreg Roach	 *
34*76692c8bSGreg Roach	 * @param string      $xref
35*76692c8bSGreg Roach	 * @param string      $gedcom  an empty string for new/pending records
36*76692c8bSGreg Roach	 * @param string|null $pending null for a record with no pending edits,
37*76692c8bSGreg Roach	 *                             empty string for records with pending deletions
38*76692c8bSGreg Roach	 * @param Tree        $tree
39*76692c8bSGreg Roach	 */
4024ec66ceSGreg Roach	public function __construct($xref, $gedcom, $pending, $tree) {
4124ec66ceSGreg Roach		parent::__construct($xref, $gedcom, $pending, $tree);
42a25f0a04SGreg Roach
43395f0fe0SGreg Roach		// Fetch family members
44395f0fe0SGreg Roach		if (preg_match_all('/^1 (?:HUSB|WIFE|CHIL) @(.+)@/m', $gedcom . $pending, $match)) {
45395f0fe0SGreg Roach			Individual::load($tree, $match[1]);
46395f0fe0SGreg Roach		}
47395f0fe0SGreg Roach
48a25f0a04SGreg Roach		if (preg_match('/^1 HUSB @(.+)@/m', $gedcom . $pending, $match)) {
4924ec66ceSGreg Roach			$this->husb = Individual::getInstance($match[1], $tree);
50a25f0a04SGreg Roach		}
51a25f0a04SGreg Roach		if (preg_match('/^1 WIFE @(.+)@/m', $gedcom . $pending, $match)) {
5224ec66ceSGreg Roach			$this->wife = Individual::getInstance($match[1], $tree);
53a25f0a04SGreg Roach		}
54a25f0a04SGreg Roach
55a25f0a04SGreg Roach		// Make sure husb/wife are the right way round.
56a5adda01SGreg Roach		if ($this->husb && $this->husb->getSex() === 'F' || $this->wife && $this->wife->getSex() === 'M') {
57a25f0a04SGreg Roach			list($this->husb, $this->wife) = array($this->wife, $this->husb);
58a25f0a04SGreg Roach		}
59a25f0a04SGreg Roach	}
60a25f0a04SGreg Roach
61*76692c8bSGreg Roach	/**
62*76692c8bSGreg Roach	 * Generate a private version of this record
63*76692c8bSGreg Roach	 *
64*76692c8bSGreg Roach	 * @param int $access_level
65*76692c8bSGreg Roach	 *
66*76692c8bSGreg Roach	 * @return string
67*76692c8bSGreg Roach	 */
68a25f0a04SGreg Roach	protected function createPrivateGedcomRecord($access_level) {
69d86cc606SGreg Roach		$SHOW_PRIVATE_RELATIONSHIPS = $this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS');
70a25f0a04SGreg Roach
71a25f0a04SGreg Roach		$rec = '0 @' . $this->xref . '@ FAM';
72a25f0a04SGreg Roach		// Just show the 1 CHIL/HUSB/WIFE tag, not any subtags, which may contain private data
73a25f0a04SGreg Roach		preg_match_all('/\n1 (?:CHIL|HUSB|WIFE) @(' . WT_REGEX_XREF . ')@/', $this->gedcom, $matches, PREG_SET_ORDER);
74a25f0a04SGreg Roach		foreach ($matches as $match) {
7524ec66ceSGreg Roach			$rela = Individual::getInstance($match[1], $this->tree);
76a25f0a04SGreg Roach			if ($rela && ($SHOW_PRIVATE_RELATIONSHIPS || $rela->canShow($access_level))) {
77a25f0a04SGreg Roach				$rec .= $match[0];
78a25f0a04SGreg Roach			}
79a25f0a04SGreg Roach		}
80a25f0a04SGreg Roach
81a25f0a04SGreg Roach		return $rec;
82a25f0a04SGreg Roach	}
83a25f0a04SGreg Roach
84*76692c8bSGreg Roach	/**
85*76692c8bSGreg Roach	 * Fetch data from the database
86*76692c8bSGreg Roach	 *
87*76692c8bSGreg Roach	 * @param string $xref
88*76692c8bSGreg Roach	 * @param int    $tree_id
89*76692c8bSGreg Roach	 *
90*76692c8bSGreg Roach	 * @return null|string
91*76692c8bSGreg Roach	 */
9264d9078aSGreg Roach	protected static function fetchGedcomRecord($xref, $tree_id) {
9364d9078aSGreg Roach		return Database::prepare(
9464d9078aSGreg Roach			"SELECT f_gedcom FROM `##families` WHERE f_id = :xref AND f_file = :tree_id"
9564d9078aSGreg Roach		)->execute(array(
9664d9078aSGreg Roach			'xref'    => $xref,
9764d9078aSGreg Roach			'tree_id' => $tree_id,
9864d9078aSGreg Roach		))->fetchOne();
99a25f0a04SGreg Roach	}
100a25f0a04SGreg Roach
101a25f0a04SGreg Roach	/**
102a25f0a04SGreg Roach	 * Get the male (or first female) partner of the family
103a25f0a04SGreg Roach	 *
104a25f0a04SGreg Roach	 * @return Individual|null
105a25f0a04SGreg Roach	 */
106ffd703eaSGreg Roach	public function getHusband() {
107a25f0a04SGreg Roach		if ($this->husb && $this->husb->canShowName()) {
108a25f0a04SGreg Roach			return $this->husb;
109a25f0a04SGreg Roach		} else {
110a25f0a04SGreg Roach			return null;
111a25f0a04SGreg Roach		}
112a25f0a04SGreg Roach	}
113a25f0a04SGreg Roach
114a25f0a04SGreg Roach	/**
115a25f0a04SGreg Roach	 * Get the female (or second male) partner of the family
116a25f0a04SGreg Roach	 *
117a25f0a04SGreg Roach	 * @return Individual|null
118a25f0a04SGreg Roach	 */
119ffd703eaSGreg Roach	public function getWife() {
120a25f0a04SGreg Roach		if ($this->wife && $this->wife->canShowName()) {
121a25f0a04SGreg Roach			return $this->wife;
122a25f0a04SGreg Roach		} else {
123a25f0a04SGreg Roach			return null;
124a25f0a04SGreg Roach		}
125a25f0a04SGreg Roach	}
126a25f0a04SGreg Roach
127*76692c8bSGreg Roach	/**
128*76692c8bSGreg Roach	 * Each object type may have its own special rules, and re-implement this function.
129*76692c8bSGreg Roach	 *
130*76692c8bSGreg Roach	 * @param int $access_level
131*76692c8bSGreg Roach	 *
132*76692c8bSGreg Roach	 * @return bool
133*76692c8bSGreg Roach	 */
134a25f0a04SGreg Roach	protected function canShowByType($access_level) {
135a25f0a04SGreg Roach		// Hide a family if any member is private
136a25f0a04SGreg Roach		preg_match_all('/\n1 (?:CHIL|HUSB|WIFE) @(' . WT_REGEX_XREF . ')@/', $this->gedcom, $matches);
137a25f0a04SGreg Roach		foreach ($matches[1] as $match) {
13824ec66ceSGreg Roach			$person = Individual::getInstance($match, $this->tree);
139a25f0a04SGreg Roach			if ($person && !$person->canShow($access_level)) {
140a25f0a04SGreg Roach				return false;
141a25f0a04SGreg Roach			}
142a25f0a04SGreg Roach		}
143a25f0a04SGreg Roach
144a25f0a04SGreg Roach		return true;
145a25f0a04SGreg Roach	}
146a25f0a04SGreg Roach
147*76692c8bSGreg Roach	/**
148*76692c8bSGreg Roach	 * Can the name of this record be shown?
149*76692c8bSGreg Roach	 *
150*76692c8bSGreg Roach	 * @param int|null $access_level
151*76692c8bSGreg Roach	 *
152*76692c8bSGreg Roach	 * @return bool
153*76692c8bSGreg Roach	 */
1544b9ff166SGreg Roach	public function canShowName($access_level = null) {
155a25f0a04SGreg Roach		// We can always see the name (Husband-name + Wife-name), however,
156a25f0a04SGreg Roach		// the name will often be "private + private"
157a25f0a04SGreg Roach		return true;
158a25f0a04SGreg Roach	}
159a25f0a04SGreg Roach
160a25f0a04SGreg Roach	/**
161a25f0a04SGreg Roach	 * Find the spouse of a person.
162a25f0a04SGreg Roach	 *
163a25f0a04SGreg Roach	 * @param Individual $person
164a25f0a04SGreg Roach	 *
165a25f0a04SGreg Roach	 * @return Individual|null
166a25f0a04SGreg Roach	 */
167ffd703eaSGreg Roach	public function getSpouse(Individual $person) {
168a25f0a04SGreg Roach		if ($person === $this->wife) {
169a25f0a04SGreg Roach			return $this->husb;
170a25f0a04SGreg Roach		} else {
171a25f0a04SGreg Roach			return $this->wife;
172a25f0a04SGreg Roach		}
173a25f0a04SGreg Roach	}
174a25f0a04SGreg Roach
175a25f0a04SGreg Roach	/**
176a25f0a04SGreg Roach	 * Get the (zero, one or two) spouses from this family.
177a25f0a04SGreg Roach	 *
178cbc1590aSGreg Roach	 * @param int|null $access_level
179a25f0a04SGreg Roach	 *
180a25f0a04SGreg Roach	 * @return Individual[]
181a25f0a04SGreg Roach	 */
182ffd703eaSGreg Roach	public function getSpouses($access_level = null) {
1834b9ff166SGreg Roach		if ($access_level === null) {
1844b9ff166SGreg Roach			$access_level = Auth::accessLevel($this->tree);
1854b9ff166SGreg Roach		}
1864b9ff166SGreg Roach
187a25f0a04SGreg Roach		$spouses = array();
188a25f0a04SGreg Roach		if ($this->husb && $this->husb->canShowName($access_level)) {
189a25f0a04SGreg Roach			$spouses[] = $this->husb;
190a25f0a04SGreg Roach		}
191a25f0a04SGreg Roach		if ($this->wife && $this->wife->canShowName($access_level)) {
192a25f0a04SGreg Roach			$spouses[] = $this->wife;
193a25f0a04SGreg Roach		}
194a25f0a04SGreg Roach
195a25f0a04SGreg Roach		return $spouses;
196a25f0a04SGreg Roach	}
197a25f0a04SGreg Roach
198a25f0a04SGreg Roach	/**
199a25f0a04SGreg Roach	 * Get a list of this family’s children.
200a25f0a04SGreg Roach	 *
201cbc1590aSGreg Roach	 * @param int|null $access_level
202a25f0a04SGreg Roach	 *
203a25f0a04SGreg Roach	 * @return Individual[]
204a25f0a04SGreg Roach	 */
205ffd703eaSGreg Roach	public function getChildren($access_level = null) {
2064b9ff166SGreg Roach		if ($access_level === null) {
2074b9ff166SGreg Roach			$access_level = Auth::accessLevel($this->tree);
2084b9ff166SGreg Roach		}
2094b9ff166SGreg Roach
210d86cc606SGreg Roach		$SHOW_PRIVATE_RELATIONSHIPS = $this->tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS');
211a25f0a04SGreg Roach
212a25f0a04SGreg Roach		$children = array();
213a25f0a04SGreg Roach		foreach ($this->getFacts('CHIL', false, $access_level, $SHOW_PRIVATE_RELATIONSHIPS) as $fact) {
214a25f0a04SGreg Roach			$child = $fact->getTarget();
215a25f0a04SGreg Roach			if ($child && ($SHOW_PRIVATE_RELATIONSHIPS || $child->canShowName($access_level))) {
216a25f0a04SGreg Roach				$children[] = $child;
217a25f0a04SGreg Roach			}
218a25f0a04SGreg Roach		}
219a25f0a04SGreg Roach
220a25f0a04SGreg Roach		return $children;
221a25f0a04SGreg Roach	}
222a25f0a04SGreg Roach
223a25f0a04SGreg Roach	/**
224a25f0a04SGreg Roach	 * Static helper function to sort an array of families by marriage date
225a25f0a04SGreg Roach	 *
226a25f0a04SGreg Roach	 * @param Family $x
227a25f0a04SGreg Roach	 * @param Family $y
228a25f0a04SGreg Roach	 *
229cbc1590aSGreg Roach	 * @return int
230a25f0a04SGreg Roach	 */
231a25f0a04SGreg Roach	public static function compareMarrDate(Family $x, Family $y) {
232f5b60decSGreg Roach		return Date::compare($x->getMarriageDate(), $y->getMarriageDate());
233a25f0a04SGreg Roach	}
234a25f0a04SGreg Roach
235a25f0a04SGreg Roach	/**
236a25f0a04SGreg Roach	 * Number of children - for the individual list
237a25f0a04SGreg Roach	 *
238cbc1590aSGreg Roach	 * @return int
239a25f0a04SGreg Roach	 */
240a25f0a04SGreg Roach	public function getNumberOfChildren() {
241a25f0a04SGreg Roach		$nchi = count($this->getChildren());
242a25f0a04SGreg Roach		foreach ($this->getFacts('NCHI') as $fact) {
243a25f0a04SGreg Roach			$nchi = max($nchi, (int) $fact->getValue());
244a25f0a04SGreg Roach		}
245a25f0a04SGreg Roach
246a25f0a04SGreg Roach		return $nchi;
247a25f0a04SGreg Roach	}
248a25f0a04SGreg Roach
249a25f0a04SGreg Roach	/**
250a25f0a04SGreg Roach	 * get the marriage event
251a25f0a04SGreg Roach	 *
252a25f0a04SGreg Roach	 * @return Fact
253a25f0a04SGreg Roach	 */
254a25f0a04SGreg Roach	public function getMarriage() {
255a25f0a04SGreg Roach		return $this->getFirstFact('MARR');
256a25f0a04SGreg Roach	}
257a25f0a04SGreg Roach
258a25f0a04SGreg Roach	/**
259a25f0a04SGreg Roach	 * Get marriage date
260a25f0a04SGreg Roach	 *
261a25f0a04SGreg Roach	 * @return Date
262a25f0a04SGreg Roach	 */
263a25f0a04SGreg Roach	public function getMarriageDate() {
264a25f0a04SGreg Roach		$marriage = $this->getMarriage();
265a25f0a04SGreg Roach		if ($marriage) {
266a25f0a04SGreg Roach			return $marriage->getDate();
267a25f0a04SGreg Roach		} else {
268a25f0a04SGreg Roach			return new Date('');
269a25f0a04SGreg Roach		}
270a25f0a04SGreg Roach	}
271a25f0a04SGreg Roach
272a25f0a04SGreg Roach	/**
273a25f0a04SGreg Roach	 * Get the marriage year - displayed on lists of families
274a25f0a04SGreg Roach	 *
275cbc1590aSGreg Roach	 * @return int
276a25f0a04SGreg Roach	 */
277a25f0a04SGreg Roach	public function getMarriageYear() {
278f5b60decSGreg Roach		return $this->getMarriageDate()->minimumDate()->y;
279a25f0a04SGreg Roach	}
280a25f0a04SGreg Roach
281a25f0a04SGreg Roach	/**
282a25f0a04SGreg Roach	 * Get the type for this marriage
283a25f0a04SGreg Roach	 *
284a25f0a04SGreg Roach	 * @return string|null
285a25f0a04SGreg Roach	 */
286a25f0a04SGreg Roach	public function getMarriageType() {
287a25f0a04SGreg Roach		$marriage = $this->getMarriage();
288a25f0a04SGreg Roach		if ($marriage) {
289a25f0a04SGreg Roach			return $marriage->getAttribute('TYPE');
290a25f0a04SGreg Roach		} else {
291a25f0a04SGreg Roach			return null;
292a25f0a04SGreg Roach		}
293a25f0a04SGreg Roach	}
294a25f0a04SGreg Roach
295a25f0a04SGreg Roach	/**
296a25f0a04SGreg Roach	 * Get the marriage place
297a25f0a04SGreg Roach	 *
298a25f0a04SGreg Roach	 * @return Place
299a25f0a04SGreg Roach	 */
300a25f0a04SGreg Roach	public function getMarriagePlace() {
301a25f0a04SGreg Roach		$marriage = $this->getMarriage();
302a25f0a04SGreg Roach
303a25f0a04SGreg Roach		return $marriage->getPlace();
304a25f0a04SGreg Roach	}
305a25f0a04SGreg Roach
306a25f0a04SGreg Roach	/**
307a25f0a04SGreg Roach	 * Get a list of all marriage dates - for the family lists.
308a25f0a04SGreg Roach	 *
309a25f0a04SGreg Roach	 * @return Date[]
310a25f0a04SGreg Roach	 */
311a25f0a04SGreg Roach	public function getAllMarriageDates() {
312a25f0a04SGreg Roach		foreach (explode('|', WT_EVENTS_MARR) as $event) {
313a25f0a04SGreg Roach			if ($array = $this->getAllEventDates($event)) {
314a25f0a04SGreg Roach				return $array;
315a25f0a04SGreg Roach			}
316a25f0a04SGreg Roach		}
317a25f0a04SGreg Roach
318a25f0a04SGreg Roach		return array();
319a25f0a04SGreg Roach	}
320a25f0a04SGreg Roach
321a25f0a04SGreg Roach	/**
322a25f0a04SGreg Roach	 * Get a list of all marriage places - for the family lists.
323a25f0a04SGreg Roach	 *
324a25f0a04SGreg Roach	 * @return string[]
325a25f0a04SGreg Roach	 */
326a25f0a04SGreg Roach	public function getAllMarriagePlaces() {
327a25f0a04SGreg Roach		foreach (explode('|', WT_EVENTS_MARR) as $event) {
328a25f0a04SGreg Roach			if ($array = $this->getAllEventPlaces($event)) {
329a25f0a04SGreg Roach				return $array;
330a25f0a04SGreg Roach			}
331a25f0a04SGreg Roach		}
332a25f0a04SGreg Roach
333a25f0a04SGreg Roach		return array();
334a25f0a04SGreg Roach	}
335a25f0a04SGreg Roach
336*76692c8bSGreg Roach	/**
337*76692c8bSGreg Roach	 * Derived classes should redefine this function, otherwise the object will have no name
338*76692c8bSGreg Roach	 *
339*76692c8bSGreg Roach	 * @return string[][]
340*76692c8bSGreg Roach	 */
341a25f0a04SGreg Roach	public function getAllNames() {
342a25f0a04SGreg Roach		if (is_null($this->_getAllNames)) {
343a25f0a04SGreg Roach			// Check the script used by each name, so we can match cyrillic with cyrillic, greek with greek, etc.
344a25f0a04SGreg Roach			if ($this->husb) {
345a25f0a04SGreg Roach				$husb_names = $this->husb->getAllNames();
346a25f0a04SGreg Roach			} else {
347a25f0a04SGreg Roach				$husb_names = array(
348a25f0a04SGreg Roach					0 => array(
349a25f0a04SGreg Roach						'type' => 'BIRT',
350a25f0a04SGreg Roach						'sort' => '@N.N.',
351ad1a1cd2SGreg Roach						'full' => I18N::translateContext('Unknown given name', '…') . ' ' . I18N::translateContext('Unknown surname', '…'),
352a25f0a04SGreg Roach					),
353a25f0a04SGreg Roach				);
354a25f0a04SGreg Roach			}
355a25f0a04SGreg Roach			foreach ($husb_names as $n => $husb_name) {
356a25f0a04SGreg Roach				$husb_names[$n]['script'] = I18N::textScript($husb_name['full']);
357a25f0a04SGreg Roach			}
358a25f0a04SGreg Roach			if ($this->wife) {
359a25f0a04SGreg Roach				$wife_names = $this->wife->getAllNames();
360a25f0a04SGreg Roach			} else {
361a25f0a04SGreg Roach				$wife_names = array(
362a25f0a04SGreg Roach					0 => array(
363a25f0a04SGreg Roach						'type' => 'BIRT',
364a25f0a04SGreg Roach						'sort' => '@N.N.',
365ad1a1cd2SGreg Roach						'full' => I18N::translateContext('Unknown given name', '…') . ' ' . I18N::translateContext('Unknown surname', '…'),
366a25f0a04SGreg Roach					),
367a25f0a04SGreg Roach				);
368a25f0a04SGreg Roach			}
369a25f0a04SGreg Roach			foreach ($wife_names as $n => $wife_name) {
370a25f0a04SGreg Roach				$wife_names[$n]['script'] = I18N::textScript($wife_name['full']);
371a25f0a04SGreg Roach			}
372a25f0a04SGreg Roach			// Add the matched names first
373a25f0a04SGreg Roach			foreach ($husb_names as $husb_name) {
374a25f0a04SGreg Roach				foreach ($wife_names as $wife_name) {
375a25f0a04SGreg Roach					if ($husb_name['type'] != '_MARNM' && $wife_name['type'] != '_MARNM' && $husb_name['script'] == $wife_name['script']) {
376a25f0a04SGreg Roach						$this->_getAllNames[] = array(
377a25f0a04SGreg Roach							'type' => $husb_name['type'],
378a25f0a04SGreg Roach							'sort' => $husb_name['sort'] . ' + ' . $wife_name['sort'],
379a25f0a04SGreg Roach							'full' => $husb_name['full'] . ' + ' . $wife_name['full'],
380a25f0a04SGreg Roach							// No need for a fullNN entry - we do not currently store FAM names in the database
381a25f0a04SGreg Roach						);
382a25f0a04SGreg Roach					}
383a25f0a04SGreg Roach				}
384a25f0a04SGreg Roach			}
385a25f0a04SGreg Roach			// Add the unmatched names second (there may be no matched names)
386a25f0a04SGreg Roach			foreach ($husb_names as $husb_name) {
387a25f0a04SGreg Roach				foreach ($wife_names as $wife_name) {
388a25f0a04SGreg Roach					if ($husb_name['type'] != '_MARNM' && $wife_name['type'] != '_MARNM' && $husb_name['script'] != $wife_name['script']) {
389a25f0a04SGreg Roach						$this->_getAllNames[] = array(
390a25f0a04SGreg Roach							'type' => $husb_name['type'],
391a25f0a04SGreg Roach							'sort' => $husb_name['sort'] . ' + ' . $wife_name['sort'],
392a25f0a04SGreg Roach							'full' => $husb_name['full'] . ' + ' . $wife_name['full'],
393a25f0a04SGreg Roach							// No need for a fullNN entry - we do not currently store FAM names in the database
394a25f0a04SGreg Roach						);
395a25f0a04SGreg Roach					}
396a25f0a04SGreg Roach				}
397a25f0a04SGreg Roach			}
398a25f0a04SGreg Roach		}
399a25f0a04SGreg Roach
400a25f0a04SGreg Roach		return $this->_getAllNames;
401a25f0a04SGreg Roach	}
402a25f0a04SGreg Roach
403*76692c8bSGreg Roach	/**
404*76692c8bSGreg Roach	 * This function should be redefined in derived classes to show any major
405*76692c8bSGreg Roach	 * identifying characteristics of this record.
406*76692c8bSGreg Roach	 *
407*76692c8bSGreg Roach	 * @return string
408*76692c8bSGreg Roach	 */
409ffd703eaSGreg Roach	public function formatListDetails() {
410a25f0a04SGreg Roach		return
411841014f1SGreg Roach			$this->formatFirstMajorFact(WT_EVENTS_MARR, 1) .
412841014f1SGreg Roach			$this->formatFirstMajorFact(WT_EVENTS_DIV, 1);
413a25f0a04SGreg Roach	}
414a25f0a04SGreg Roach}
415