本文整理汇总了PHP中Fisharebest\Webtrees\GedcomRecord::getAllNames方法的典型用法代码示例。如果您正苦于以下问题:PHP GedcomRecord::getAllNames方法的具体用法?PHP GedcomRecord::getAllNames怎么用?PHP GedcomRecord::getAllNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\GedcomRecord
的用法示例。
在下文中一共展示了GedcomRecord::getAllNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateNames
/**
* Extract all the names from the given record and insert them into the database.
*
* @param string $xref
* @param int $ged_id
* @param GedcomRecord $record
*/
public static function updateNames($xref, $ged_id, GedcomRecord $record)
{
foreach ($record->getAllNames() as $n => $name) {
if ($record instanceof Individual) {
if ($name['givn'] === '@P.N.') {
$soundex_givn_std = null;
$soundex_givn_dm = null;
} else {
$soundex_givn_std = Soundex::russell($name['givn']);
$soundex_givn_dm = Soundex::daitchMokotoff($name['givn']);
}
if ($name['surn'] === '@N.N.') {
$soundex_surn_std = null;
$soundex_surn_dm = null;
} else {
$soundex_surn_std = Soundex::russell($name['surname']);
$soundex_surn_dm = Soundex::daitchMokotoff($name['surname']);
}
Database::prepare("INSERT INTO `##name` (n_file,n_id,n_num,n_type,n_sort,n_full,n_surname,n_surn,n_givn,n_soundex_givn_std,n_soundex_surn_std,n_soundex_givn_dm,n_soundex_surn_dm) VALUES (?, ?, ?, ?, LEFT(?, 255), LEFT(?, 255), LEFT(?, 255), LEFT(?, 255), ?, ?, ?, ?, ?)")->execute(array($ged_id, $xref, $n, $name['type'], $name['sort'], $name['fullNN'], $name['surname'], $name['surn'], $name['givn'], $soundex_givn_std, $soundex_surn_std, $soundex_givn_dm, $soundex_surn_dm));
} else {
Database::prepare("INSERT INTO `##name` (n_file,n_id,n_num,n_type,n_sort,n_full) VALUES (?, ?, ?, ?, LEFT(?, 255), LEFT(?, 255))")->execute(array($ged_id, $xref, $n, $name['type'], $name['sort'], $name['fullNN']));
}
}
}