本文整理汇总了PHP中Fisharebest\Webtrees\Individual::getBirthPlace方法的典型用法代码示例。如果您正苦于以下问题:PHP Individual::getBirthPlace方法的具体用法?PHP Individual::getBirthPlace怎么用?PHP Individual::getBirthPlace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Individual
的用法示例。
在下文中一共展示了Individual::getBirthPlace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate
/**
* Generate the likely value of this census column, based on available information.
*
* @param Individual $individual
* @param Individual|null $head
*
* @return string
*/
public function generate(Individual $individual, Individual $head = null)
{
$birth_place = $individual->getBirthPlace();
$census_place = $this->place();
// Ignore the census country
if ($birth_place === $census_place) {
return '';
}
if (substr($birth_place, -strlen($census_place) - 2) === ', ' . $census_place) {
return substr($birth_place, 0, -strlen($census_place) - 2);
} else {
return $birth_place;
}
}
示例2: generate
/**
* Generate the likely value of this census column, based on available information.
*
* @param Individual $individual
* @param Individual|null $head
*
* @return string
*/
public function generate(Individual $individual, Individual $head = null)
{
$place = $individual->getBirthPlace();
// Did we emigrate or naturalise?
foreach ($individual->getFacts('IMMI|EMIG|NATU', true) as $fact) {
if (Date::compare($fact->getDate(), $this->date()) <= 0) {
$place = $fact->getPlace()->getGedcomName();
}
}
$place = explode(', ', $place);
$place = end($place);
if ($place === 'England' || $place === 'Scotland' || $place === 'Wales') {
return 'British';
} else {
return $place;
}
}
示例3: generate
/**
* Generate the likely value of this census column, based on available information.
*
* @param Individual $individual
* @param Individual|null $head
*
* @return string
*/
public function generate(Individual $individual, Individual $head = null)
{
$birth_place = explode(', ', $individual->getBirthPlace());
$birth_place = end($birth_place);
$census_place = $this->place();
if ($birth_place === 'Wales') {
$birth_place = 'England';
}
if ($census_place === 'Wales') {
$census_place = 'England';
}
if ($birth_place === $census_place || $birth_place === '') {
return '';
} elseif ($birth_place === 'England' || $birth_place === 'Scotland' || $birth_place === 'Ireland') {
return substr($birth_place, 0, 1);
} else {
return 'F';
}
}