本文整理汇总了PHP中Fisharebest\Webtrees\Individual::getBirthDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Individual::getBirthDate方法的具体用法?PHP Individual::getBirthDate怎么用?PHP Individual::getBirthDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Individual
的用法示例。
在下文中一共展示了Individual::getBirthDate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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->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 '';
}
}
示例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->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 '';
}
示例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_date = $individual->getBirthDate();
if ($birth_date->minimumJulianDay() === $birth_date->maximumJulianDay()) {
return $birth_date->minimumDate()->format('%j/%n');
} else {
return '';
}
}
示例4: getRelationshipNameFromPath
/**
* Convert a relationship path into a relationship name.
*
* @param string $path
* @param Individual $person1
* @param Individual $person2
*
* @return string
*/
public static function getRelationshipNameFromPath($path, Individual $person1 = null, Individual $person2 = null)
{
if (!preg_match('/^(mot|fat|par|hus|wif|spo|son|dau|chi|bro|sis|sib)*$/', $path)) {
// TODO: Update all the “3 RELA ” values in class_person
return '<span class="error">' . $path . '</span>';
}
// The path does not include the starting person. In some languages, the
// translation for a man’s (relative) is different from a woman’s (relative),
// due to inflection.
$sex1 = $person1 ? $person1->getSex() : 'U';
// The sex of the last person in the relationship determines the name in
// many cases. e.g. great-aunt / great-uncle
if (preg_match('/(fat|hus|son|bro)$/', $path)) {
$sex2 = 'M';
} elseif (preg_match('/(mot|wif|dau|sis)$/', $path)) {
$sex2 = 'F';
} else {
$sex2 = 'U';
}
switch ($path) {
case '':
return I18N::translate('self');
// Level One relationships
// Level One relationships
case 'mot':
return I18N::translate('mother');
case 'fat':
return I18N::translate('father');
case 'par':
return I18N::translate('parent');
case 'hus':
if ($person1 && $person2) {
foreach ($person1->getSpouseFamilies() as $family) {
if ($person2 === $family->getSpouse($person1)) {
if ($family->getFacts('_NMR')) {
if ($family->getFacts(WT_EVENTS_DIV)) {
return I18N::translateContext('MALE', 'ex-partner');
} else {
return I18N::translateContext('MALE', 'partner');
}
} elseif ($family->getFacts(WT_EVENTS_DIV)) {
return I18N::translate('ex-husband');
}
}
}
}
return I18N::translate('husband');
case 'wif':
if ($person1 && $person1) {
foreach ($person1->getSpouseFamilies() as $family) {
if ($person2 === $family->getSpouse($person1)) {
if ($family->getFacts('_NMR')) {
if ($family->getFacts(WT_EVENTS_DIV)) {
return I18N::translateContext('FEMALE', 'ex-partner');
} else {
return I18N::translateContext('FEMALE', 'partner');
}
} elseif ($family->getFacts(WT_EVENTS_DIV)) {
return I18N::translate('ex-wife');
}
}
}
}
return I18N::translate('wife');
case 'spo':
if ($person1 && $person2) {
foreach ($person1->getSpouseFamilies() as $family) {
if ($person2 === $family->getSpouse($person1)) {
if ($family->getFacts('_NMR')) {
if ($family->getFacts(WT_EVENTS_DIV)) {
return I18N::translateContext('MALE/FEMALE', 'ex-partner');
} else {
return I18N::translateContext('MALE/FEMALE', 'partner');
}
} elseif ($family->getFacts(WT_EVENTS_DIV)) {
return I18N::translate('ex-spouse');
}
}
}
}
return I18N::translate('spouse');
case 'son':
return I18N::translate('son');
case 'dau':
return I18N::translate('daughter');
case 'chi':
return I18N::translate('child');
case 'bro':
if ($person1 && $person2) {
$dob1 = $person1->getBirthDate();
$dob2 = $person2->getBirthDate();
//.........这里部分代码省略.........