當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。