当前位置: 首页>>代码示例>>PHP>>正文


PHP Individual::getBirthPlace方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:22,代码来源:CensusColumnBirthPlace.php

示例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;
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:25,代码来源:CensusColumnNationality.php

示例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';
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:27,代码来源:CensusColumnBornForeignParts.php


注:本文中的Fisharebest\Webtrees\Individual::getBirthPlace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。