本文整理匯總了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;
}