本文整理汇总了PHP中Source::setChanged方法的典型用法代码示例。如果您正苦于以下问题:PHP Source::setChanged方法的具体用法?PHP Source::setChanged怎么用?PHP Source::setChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Source
的用法示例。
在下文中一共展示了Source::setChanged方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list
static function &getInstance($data, $simple = true)
{
global $gedcom_record_cache, $GEDCOM, $pgv_changes;
if (is_array($data)) {
$ged_id = $data['ged_id'];
$pid = $data['xref'];
} else {
$ged_id = get_id_from_gedcom($GEDCOM);
$pid = $data;
}
// Check the cache first
if (isset($gedcom_record_cache[$pid][$ged_id])) {
return $gedcom_record_cache[$pid][$ged_id];
}
// Look for the record in the database
if (!is_array($data)) {
$data = fetch_source_record($pid, $ged_id);
// If we didn't find the record in the database, it may be remote
if (!$data && strpos($pid, ':')) {
list($servid, $remoteid) = explode(':', $pid);
$service = ServiceClient::getInstance($servid);
if ($service) {
// TYPE will be replaced with the type from the remote record
$data = $service->mergeGedcomRecord($remoteid, "0 @{$pid}@ TYPE\n1 RFN {$pid}", false);
}
}
// If we didn't find the record in the database, it may be new/pending
if (!$data && PGV_USER_CAN_EDIT && isset($pgv_changes[$pid . '_' . $GEDCOM])) {
$data = find_updated_record($pid);
$fromfile = true;
}
// If we still didn't find it, it doesn't exist
if (!$data) {
return null;
}
}
// Create the object
$object = new Source($data, $simple);
if (!empty($fromfile)) {
$object->setChanged(true);
}
// Store it in the cache
$gedcom_record_cache[$object->xref][$object->ged_id] =& $object;
//-- also store it using its reference id (sid:pid and local gedcom for remote links)
$gedcom_record_cache[$pid][$ged_id] =& $object;
return $object;
}