本文整理汇总了PHP中Fisharebest\Webtrees\Individual::linkedFamilies方法的典型用法代码示例。如果您正苦于以下问题:PHP Individual::linkedFamilies方法的具体用法?PHP Individual::linkedFamilies怎么用?PHP Individual::linkedFamilies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Individual
的用法示例。
在下文中一共展示了Individual::linkedFamilies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: associateFacts
/**
* Get the events of associates.
*
* @param Individual $person
*
* @return Fact[]
*/
private static function associateFacts(Individual $person)
{
$facts = array();
$associates = array_merge($person->linkedIndividuals('ASSO'), $person->linkedIndividuals('_ASSO'), $person->linkedFamilies('ASSO'), $person->linkedFamilies('_ASSO'));
foreach ($associates as $associate) {
foreach ($associate->getFacts() as $fact) {
$arec = $fact->getAttribute('_ASSO');
if (!$arec) {
$arec = $fact->getAttribute('ASSO');
}
if ($arec && trim($arec, '@') === $person->getXref()) {
// Extract the important details from the fact
$factrec = '1 ' . $fact->getTag();
if (preg_match('/\\n2 DATE .*/', $fact->getGedcom(), $match)) {
$factrec .= $match[0];
}
if (preg_match('/\\n2 PLAC .*/', $fact->getGedcom(), $match)) {
$factrec .= $match[0];
}
if ($associate instanceof Family) {
foreach ($associate->getSpouses() as $spouse) {
$factrec .= "\n2 _ASSO @" . $spouse->getXref() . '@';
}
} else {
$factrec .= "\n2 _ASSO @" . $associate->getXref() . '@';
}
$facts[] = new Fact($factrec, $associate, 'asso');
}
}
}
return $facts;
}