當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Individual::getEstimatedBirthDate方法代碼示例

本文整理匯總了PHP中Fisharebest\Webtrees\Individual::getEstimatedBirthDate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Individual::getEstimatedBirthDate方法的具體用法?PHP Individual::getEstimatedBirthDate怎麽用?PHP Individual::getEstimatedBirthDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Fisharebest\Webtrees\Individual的用法示例。


在下文中一共展示了Individual::getEstimatedBirthDate方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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)
 {
     if ($individual->getSex() === 'F') {
         return '';
     } else {
         return (string) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
     }
 }
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:16,代碼來源:CensusColumnAgeMale.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)
 {
     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

示例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)
 {
     return $individual->getEstimatedBirthDate()->minimumDate()->format('%Y');
 }
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:12,代碼來源:CensusColumnBirthYear.php

示例4: compareBirthDate

 /**
  * Static helper function to sort an array of people by birth date
  *
  * @param Individual $x
  * @param Individual $y
  *
  * @return int
  */
 public static function compareBirthDate(Individual $x, Individual $y)
 {
     return Date::compare($x->getEstimatedBirthDate(), $y->getEstimatedBirthDate());
 }
開發者ID:bmhm,項目名稱:webtrees,代碼行數:12,代碼來源:Individual.php

示例5: historicalFacts

 /**
  * Get any historical events.
  *
  * @param Individual $person
  *
  * @return Fact[]
  */
 private static function historicalFacts(Individual $person)
 {
     $SHOW_RELATIVES_EVENTS = $person->getTree()->getPreference('SHOW_RELATIVES_EVENTS');
     $facts = array();
     if ($SHOW_RELATIVES_EVENTS) {
         // Only include events between birth and death
         $birt_date = $person->getEstimatedBirthDate();
         $deat_date = $person->getEstimatedDeathDate();
         if (file_exists(Site::getPreference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php')) {
             $histo = array();
             require Site::getPreference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php';
             foreach ($histo as $hist) {
                 // Earlier versions of the WIKI encouraged people to use HTML entities,
                 // rather than UTF8 encoding.
                 $hist = html_entity_decode($hist, ENT_QUOTES, 'UTF-8');
                 $fact = new Fact($hist, $person, 'histo');
                 $sdate = $fact->getDate();
                 if ($sdate->isOK() && Date::compare($birt_date, $sdate) <= 0 && Date::compare($sdate, $deat_date) <= 0) {
                     $facts[] = $fact;
                 }
             }
         }
     }
     return $facts;
 }
開發者ID:pal-saugstad,項目名稱:webtrees,代碼行數:32,代碼來源:IndividualFactsTabModule.php

示例6: addNode

 /**
  * Recursive method to add individual to the Sosa table, and flush it regularly
  * @param Individual $indi Individual to add
  * @param int $sosa Individual's sosa
  */
 protected function addNode(Individual $indi, $sosa)
 {
     $birth_year = $indi->getEstimatedBirthDate()->gregorianYear();
     $death_year = $indi->getEstimatedDeathDate()->gregorianYear();
     $this->tmp_sosa_table[] = array('indi' => $indi->getXref(), 'sosa' => $sosa, 'birth_year' => $birth_year, 'death_year' => $death_year);
     $this->flushTmpSosaTable();
     if ($fam = $indi->getPrimaryChildFamily()) {
         if ($husb = $fam->getHusband()) {
             $this->addNode($husb, 2 * $sosa);
         }
         if ($wife = $fam->getWife()) {
             $this->addNode($wife, 2 * $sosa + 1);
         }
     }
 }
開發者ID:jon48,項目名稱:webtrees-lib,代碼行數:20,代碼來源:SosaCalculator.php

示例7: isChild

 /**
  * Is the individual a child.
  *
  * @param Individual $individual
  *
  * @return bool
  */
 private function isChild(Individual $individual)
 {
     $age = (int) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0);
     return $age < $this->age_adult;
 }
開發者ID:tronsmit,項目名稱:webtrees,代碼行數:12,代碼來源:AbstractCensusColumnCondition.php


注:本文中的Fisharebest\Webtrees\Individual::getEstimatedBirthDate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。