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


PHP Webtrees\Individual类代码示例

本文整理汇总了PHP中Fisharebest\Webtrees\Individual的典型用法代码示例。如果您正苦于以下问题:PHP Individual类的具体用法?PHP Individual怎么用?PHP Individual使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Individual类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
 {
     foreach ($individual->getFacts('OCCU') as $fact) {
         return $fact->getValue();
     }
     return '';
 }
开发者ID:tunandras,项目名称:webtrees,代码行数:15,代码来源:CensusColumnOccupation.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)
 {
     foreach ($individual->getAllNames() as $name) {
         return $name['surn'] . ', ' . $name['givn'];
     }
     return '';
 }
开发者ID:AlexSnet,项目名称:webtrees,代码行数:15,代码来源:CensusColumnSurnameGivenNames.php

示例3: getChartMenu

 /**
  * Return a menu item for this chart.
  * 
  * We can only do this if the GD2 library is installed with TrueType support.	 	 
  *
  * @return Menu|null
  */
 public function getChartMenu(Individual $individual)
 {
     if (function_exists('imagettftext')) {
         return new Menu($this->getTitle(), 'fanchart.php?rootid=' . $individual->getXref() . '&ged=' . $individual->getTree()->getNameUrl(), 'menu-chart-fanchart', array('rel' => 'nofollow'));
     } else {
         return null;
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:15,代码来源:FanChartModule.php

示例4: 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)
 {
     if ($individual->getSex() === 'F') {
         return '';
     } else {
         return (string) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:16,代码来源:CensusColumnAgeMale.php

示例5: getSpouseById

 /**
  * Find the spouse of a person, using the Xref comparison.
  *
  * @param Individual $person
  *
  * @return Individual|null
  */
 public function getSpouseById(\Fisharebest\Webtrees\Individual $person)
 {
     if ($this->gedcomrecord->getWife() && $person->getXref() === $this->gedcomrecord->getWife()->getXref()) {
         return $this->gedcomrecord->getHusband();
     } else {
         return $this->gedcomrecord->getWife();
     }
 }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:15,代码来源:Family.php

示例6: 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)
 {
     if ($individual->getBirthDate()->julianDay() + 365 >= $this->date()->julianDay()) {
         // Use the GEDCOM month, as we need this in English - for the US census
         return ucfirst(strtolower($individual->getBirthDate()->minimumDate()->format('%O')));
     } else {
         return '';
     }
 }
开发者ID:tunandras,项目名称:webtrees,代码行数:17,代码来源:CensusColumnMonthIfBornWithinYear.php

示例7: 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_date = $individual->getBirthDate();
     if ($birth_date->minimumJulianDay() === $birth_date->maximumJulianDay()) {
         return $birth_date->minimumDate()->format('%j/%n');
     } else {
         return '';
     }
 }
开发者ID:AlexSnet,项目名称:webtrees,代码行数:17,代码来源:CensusColumnBirthDaySlashMonth.php

示例8: 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)
 {
     $sex = $individual->getSex();
     if ($sex === 'M' || $sex === 'F') {
         return $sex;
     } else {
         return '';
     }
 }
开发者ID:tunandras,项目名称:webtrees,代码行数:17,代码来源:CensusColumnSexMF.php

示例9: getChartMenu

 /**
  * Return a menu item for this chart.
  *
  * @param Individual $individual
  *
  * @return Menu|null
  */
 public function getChartMenu(Individual $individual)
 {
     $tree = $individual->getTree();
     $gedcomid = $tree->getUserPreference(Auth::user(), 'gedcomid');
     if ($gedcomid) {
         return new Menu(I18N::translate('Relationship to me'), 'relationship.php?pid1=' . $gedcomid . '&pid2=' . $individual->getXref() . '&ged=' . $tree->getNameUrl(), 'menu-chart-relationship', array('rel' => 'nofollow'));
     } else {
         return new Menu(I18N::translate('Relationships'), 'relationship.php?pid1=' . $individual->getXref() . '&ged=' . $tree->getNameUrl(), 'menu-chart-relationship', array('rel' => 'nofollow'));
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:17,代码来源:RelationshipsChartModule.php

示例10: 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)
 {
     foreach ($individual->getSpouseFamilies() as $family) {
         foreach ($family->getFacts('MARR') as $fact) {
             if ($fact->getDate()->julianDay() + 365 >= $this->date()->julianDay()) {
                 return 'Y';
             }
         }
     }
     return '';
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:19,代码来源:CensusColumnMarriedWithinYear.php

示例11: 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)
 {
     switch ($individual->getSex()) {
         case 'M':
             return $this->male;
         case 'F':
             return $this->female;
         default:
             return '';
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:19,代码来源:CensusColumnSexMF.php

示例12: 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)
 {
     foreach ($individual->getSpouseFamilies() as $family) {
         foreach ($family->getFacts('MARR') as $fact) {
             if ($fact->getDate()->julianDay() + 365 >= $this->date()->julianDay()) {
                 // Use the GEDCOM month, as we need this in English - for the US census
                 return ucfirst(strtolower($fact->getDate()->minimumDate()->format('%O')));
             }
         }
     }
     return '';
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:20,代码来源:CensusColumnMonthIfMarriedWithinYear.php

示例13: 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)
 {
     foreach ($individual->getAllNames() as $name) {
         $given = $name['givn'];
         if (strpos($given, ' ') === false) {
             return $given;
         } else {
             return substr($given, 0, strpos($given, ' ') + 2);
         }
     }
     return '';
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:20,代码来源:CensusColumnGivenNameInitial.php

示例14: 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)
 {
     if ($individual->getSex() === 'M') {
         return '';
     } else {
         $years = Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
         if ($years > 15) {
             $years -= $years % 5;
         }
         return (string) $years;
     }
 }
开发者ID:tunandras,项目名称:webtrees,代码行数:20,代码来源:CensusColumnAgeFemale5Years.php

示例15: 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)
 {
     if ($individual->getBirthDate()->isOK()) {
         foreach ($individual->getSpouseFamilies() as $family) {
             foreach ($family->getFacts('MARR', true) as $fact) {
                 if ($fact->getDate()->isOK()) {
                     return Date::getAge($individual->getBirthDate(), $fact->getDate(), 0);
                 }
             }
         }
     }
     return '';
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:21,代码来源:CensusColumnAgeMarried.php


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