本文整理汇总了PHP中Family::loadPage方法的典型用法代码示例。如果您正苦于以下问题:PHP Family::loadPage方法的具体用法?PHP Family::loadPage怎么用?PHP Family::loadPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Family
的用法示例。
在下文中一共展示了Family::loadPage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: readPageXml
function readPageXml($title)
{
$page = null;
$xml = null;
$titleString = $title->getText();
if ($title->getNamespace() == NS_PERSON) {
$page = new Person($titleString);
} else {
$page = new Family($titleString);
}
if ($page) {
$page->loadPage();
$xml = $page->getPageXml();
}
return $xml;
}
示例2: readFamilyData
public static function readFamilyData($titleString, &$data, &$gedcomData, $includeRelativeData = false, $includeNonCompareData = false, $revid = 0, $timestamp = '')
{
$children = array();
$data['familyTitle'][] = $titleString;
if (GedcomUtil::isGedcomTitle($titleString)) {
$title = null;
$data['Exists'] = true;
$xml = GedcomUtil::getGedcomXml($gedcomData, $titleString);
$data['GedcomMatchTitle'] = (string) $xml['match'];
$contents = GedcomUtil::getGedcomContents($gedcomData, $titleString);
} else {
$title = Title::newFromText($titleString, NS_FAMILY);
$data['Exists'] = $title->exists();
$p = new Family($titleString);
$p->loadPage($revid);
if ($revid) {
$data['Revid'][] = $revid;
}
// for consistency with readPersonData
$xml = $p->getPageXml();
$contents = $p->getPageContents();
}
$husbandFound = $wifeFound = false;
if ($includeRelativeData) {
CompareForm::initPersonData('husband', $data);
CompareForm::initPersonData('wife', $data);
}
if (isset($xml)) {
foreach ($xml->event_fact as $ef) {
$type = (string) $ef['type'];
if ($type == Family::$MARRIAGE_TAG || $type == Family::$ALT_MARRIAGE_TAG) {
CompareForm::getDatePlace($ef, 'Marriagedate', 'Marriageplace', $data);
} else {
if ($includeNonCompareData) {
CompareForm::getOtherEvent($ef, '', $data);
}
}
}
if ($includeNonCompareData) {
CompareForm::getSINContents($xml, $contents, '', $data);
}
if ($includeRelativeData) {
$husbandFound = CompareForm::readRelativeData('husband', $xml->husband, $data, $gedcomData, true, false, $includeNonCompareData, $timestamp);
$wifeFound = CompareForm::readRelativeData('wife', $xml->wife, $data, $gedcomData, true, false, $includeNonCompareData, $timestamp);
$i = 0;
foreach ($xml->child as $c) {
$childTitle = (string) $c['title'];
if ($childTitle) {
$children[$i] = array();
CompareForm::initPersonData('child', $children[$i]);
if (GedcomUtil::isGedcomTitle($childTitle)) {
$childRevid = 0;
} else {
$t = Title::newFromText($childTitle, NS_PERSON);
$childRevid = $timestamp ? StructuredData::getRevidForTimestamp($t, $timestamp) : 0;
}
CompareForm::readPersonData('child', $childTitle, $children[$i], $gedcomData, false, false, true, $includeNonCompareData, $childRevid);
$i++;
}
}
} else {
$data['husbandTitle'] = array();
foreach ($xml->husband as $m) {
$data['husbandTitle'][] = (string) $m['title'];
}
$data['wifeTitle'] = array();
foreach ($xml->wife as $m) {
$data['wifeTitle'][] = (string) $m['title'];
}
$data['childTitle'] = array();
foreach ($xml->child as $m) {
$data['childTitle'][] = (string) $m['title'];
}
}
} else {
if ($title && StructuredData::isRedirect($contents)) {
$data['Redirect'] = true;
}
}
if ($includeRelativeData && (!$husbandFound || !$wifeFound)) {
list($fg, $fs, $mg, $ms) = StructuredData::parseFamilyTitle($titleString);
if (!$husbandFound) {
if ($fg) {
$data['husbandGiven'][] = $fg;
}
if ($fs) {
$data['husbandSurname'][] = $fs;
}
}
if (!$wifeFound) {
if ($mg) {
$data['wifeGiven'][] = $mg;
}
if ($ms) {
$data['wifeSurname'][] = $ms;
}
}
}
$data['Nomerge'] = CompareForm::getNomergeTitleStrings($title);
if ($title) {
//.........这里部分代码省略.........