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


PHP GedcomRecord::getSex方法代码示例

本文整理汇总了PHP中Fisharebest\Webtrees\GedcomRecord::getSex方法的典型用法代码示例。如果您正苦于以下问题:PHP GedcomRecord::getSex方法的具体用法?PHP GedcomRecord::getSex怎么用?PHP GedcomRecord::getSex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fisharebest\Webtrees\GedcomRecord的用法示例。


在下文中一共展示了GedcomRecord::getSex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getValue

 /**
  * Translate a code, for an optional record
  *
  * @param string            $type
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getValue($type, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'birth':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Birth');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Birth');
                 default:
                     return I18N::translateContext('Pedigree', 'Birth');
             }
         case 'adopted':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Adopted');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Adopted');
                 default:
                     return I18N::translateContext('Pedigree', 'Adopted');
             }
         case 'foster':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Foster');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Foster');
                 default:
                     return I18N::translateContext('Pedigree', 'Foster');
             }
         case 'sealing':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('Male pedigree', 'Sealing');
                 case 'F':
                     return I18N::translateContext('Female pedigree', 'Sealing');
                 default:
                     return I18N::translateContext('Pedigree', 'Sealing');
             }
         case 'rada':
             // Not standard GEDCOM - a webtrees extension
             // This is an arabic word which does not exist in other languages.
             // So, it will not have any inflected forms.
             return I18N::translate('Rada');
         default:
             return $type;
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:61,代码来源:GedcomCodePedi.php

示例2: getValue

 /**
  * Translate a code, for an (optional) record
  *
  * @param string               $type
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getValue($type, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'BOTH':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by both parents');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by both parents');
                 default:
                     return I18N::translate('Adopted by both parents');
             }
         case 'HUSB':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by father');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by father');
                 default:
                     return I18N::translate('Adopted by father');
             }
         case 'WIFE':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Adopted by mother');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Adopted by mother');
                 default:
                     return I18N::translate('Adopted by mother');
             }
         default:
             return $type;
     }
 }
开发者ID:tunandras,项目名称:webtrees,代码行数:47,代码来源:GedcomCodeAdop.php

示例3: getLabel

 /**
  * Translate a tag, for an (optional) record
  *
  * @param string               $tag
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getLabel($tag, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($tag) {
         case 'ABBR':
             return I18N::translate('Abbreviation');
         case 'ADDR':
             return I18N::translate('Address');
         case 'ADR1':
             return I18N::translate('Address line 1');
         case 'ADR2':
             return I18N::translate('Address line 2');
         case 'ADOP':
             return I18N::translate('Adoption');
         case 'ADOP:DATE':
             return I18N::translate('Date of adoption');
         case 'ADOP:PLAC':
             return I18N::translate('Place of adoption');
         case 'AFN':
             return I18N::translate('Ancestral file number');
         case 'AGE':
             return I18N::translate('Age');
         case 'AGNC':
             return I18N::translate('Agency');
         case 'ALIA':
             return I18N::translate('Alias');
         case 'ANCE':
             return I18N::translate('Generations of ancestors');
         case 'ANCI':
             return I18N::translate('Ancestors interest');
         case 'ANUL':
             return I18N::translate('Annulment');
         case 'ASSO':
             return I18N::translate('Associate');
             /* see also _ASSO */
         /* see also _ASSO */
         case 'AUTH':
             return I18N::translate('Author');
         case 'BAPL':
             return I18N::translate('LDS baptism');
         case 'BAPL:DATE':
             return I18N::translate('Date of LDS baptism');
         case 'BAPL:PLAC':
             return I18N::translate('Place of LDS baptism');
         case 'BAPM':
             return I18N::translate('Baptism');
         case 'BAPM:DATE':
             return I18N::translate('Date of baptism');
         case 'BAPM:PLAC':
             return I18N::translate('Place of baptism');
         case 'BARM':
             return I18N::translate('Bar mitzvah');
         case 'BARM:DATE':
             return I18N::translate('Date of bar mitzvah');
         case 'BARM:PLAC':
             return I18N::translate('Place of bar mitzvah');
         case 'BASM':
             return I18N::translate('Bat mitzvah');
         case 'BASM:DATE':
             return I18N::translate('Date of bat mitzvah');
         case 'BASM:PLAC':
             return I18N::translate('Place of bat mitzvah');
         case 'BIRT':
             return I18N::translate('Birth');
         case 'BIRT:DATE':
             return I18N::translate('Date of birth');
         case 'BIRT:PLAC':
             return I18N::translate('Place of birth');
         case 'BLES':
             return I18N::translate('Blessing');
         case 'BLES:DATE':
             return I18N::translate('Date of blessing');
         case 'BLES:PLAC':
             return I18N::translate('Place of blessing');
         case 'BLOB':
             return I18N::translate('Binary data object');
         case 'BURI':
             return I18N::translate('Burial');
         case 'BURI:DATE':
             return I18N::translate('Date of burial');
         case 'BURI:PLAC':
             return I18N::translate('Place of burial');
         case 'CALN':
             return I18N::translate('Call number');
         case 'CAST':
             return I18N::translate('Caste');
         case 'CAUS':
             return I18N::translate('Cause');
//.........这里部分代码省略.........
开发者ID:tunandras,项目名称:webtrees,代码行数:101,代码来源:GedcomTag.php

示例4: getValue

 /**
  * Translate a code, for an (optional) record.
  * We need the record to translate the sex (godfather/godmother) but
  * we won’t have this when adding data for new individuals.
  *
  * @param string            $type
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getValue($type, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'attendant':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Attendant');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Attendant');
                 default:
                     return I18N::translate('Attendant');
             }
         case 'attending':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Attending');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Attending');
                 default:
                     return I18N::translate('Attending');
             }
         case 'best_man':
             // always male
             return I18N::translate('Best man');
         case 'bridesmaid':
             // always female
             return I18N::translate('Bridesmaid');
         case 'buyer':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Buyer');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Buyer');
                 default:
                     return I18N::translate('Buyer');
             }
         case 'circumciser':
             // always male
             return I18N::translate('Circumciser');
         case 'civil_registrar':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Civil registrar');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Civil registrar');
                 default:
                     return I18N::translate('Civil registrar');
             }
         case 'employee':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Employee');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Employee');
                 default:
                     return I18N::translate('Employee');
             }
         case 'employer':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Employer');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Employer');
                 default:
                     return I18N::translate('Employer');
             }
         case 'foster_child':
             // no sex implied
             return I18N::translate('Foster child');
         case 'foster_father':
             // always male
             return I18N::translate('Foster father');
         case 'foster_mother':
             // always female
             return I18N::translate('Foster mother');
         case 'friend':
             switch ($sex) {
                 case 'M':
                     return I18N::translateContext('MALE', 'Friend');
                 case 'F':
                     return I18N::translateContext('FEMALE', 'Friend');
                 default:
                     return I18N::translate('Friend');
             }
         case 'godfather':
//.........这里部分代码省略.........
开发者ID:tunandras,项目名称:webtrees,代码行数:101,代码来源:GedcomCodeRela.php

示例5: getValue

 /**
  * Translate a code, for an (optional) record
  *
  * @param string               $type
  * @param GedcomRecord|null $record
  *
  * @return string
  */
 public static function getValue($type, GedcomRecord $record = null)
 {
     if ($record instanceof Individual) {
         $sex = $record->getSex();
     } else {
         $sex = 'U';
     }
     switch ($type) {
         case 'adopted':
             switch ($sex) {
                 case 'M':
                     /* I18N: The name given to a child by its adoptive parents */
                     return I18N::translateContext('MALE', 'adopted name');
                 case 'F':
                     /* I18N: The name given to a child by its adoptive parents */
                     return I18N::translateContext('FEMALE', 'adopted name');
                 default:
                     /* I18N: The name given to a child by its adoptive parents */
                     return I18N::translate('adopted name');
             }
         case 'aka':
             switch ($sex) {
                 case 'M':
                     /* I18N: The name by which an individual is also known. e.g. a professional name or a stage name */
                     return I18N::translateContext('MALE', 'also known as');
                 case 'F':
                     /* I18N: The name by which an individual is also known. e.g. a professional name or a stage name */
                     return I18N::translateContext('FEMALE', 'also known as');
                 default:
                     /* I18N: The name by which an individual is also known. e.g. a professional name or a stage name */
                     return I18N::translate('also known as');
             }
         case 'birth':
             switch ($sex) {
                 case 'M':
                     /* I18N: The name given to an individual at their birth */
                     return I18N::translateContext('MALE', 'birth name');
                 case 'F':
                     /* I18N: The name given to an individual at their birth */
                     return I18N::translateContext('FEMALE', 'birth name');
                 default:
                     /* I18N: The name given to an individual at their birth */
                     return I18N::translate('birth name');
             }
         case 'change':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name chosen by an individual, to replace their existing name (whether legal or otherwise) */
                     return I18N::translateContext('MALE', 'change of name');
                 case 'F':
                     /* I18N: A name chosen by an individual, to replace their existing name (whether legal or otherwise) */
                     return I18N::translateContext('FEMALE', 'change of name');
                 default:
                     /* I18N: A name chosen by an individual, to replace their existing name (whether legal or otherwise) */
                     return I18N::translate('change of name');
             }
         case 'estate':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name given to an individual, from the farm or estate on which they lived or worked */
                     return I18N::translateContext('MALE', 'estate name');
                 case 'F':
                     /* I18N: A name given to an individual, from the farm or estate on which they lived or worked */
                     return I18N::translateContext('FEMALE', 'estate name');
                 default:
                     /* I18N: A name given to an individual, from the farm or estate on which they lived or worked */
                     return I18N::translate('estate name');
             }
         case 'immigrant':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name taken on immigration - e.g. migrants to the USA frequently anglicized their names */
                     return I18N::translateContext('MALE', 'immigration name');
                 case 'F':
                     /* I18N: A name taken on immigration - e.g. migrants to the USA frequently anglicized their names */
                     return I18N::translateContext('FEMALE', 'immigration name');
                 default:
                     /* I18N: A name taken on immigration - e.g. migrants to the USA frequently anglicized their names */
                     return I18N::translate('immigration name');
             }
         case 'maiden':
             // Only women have “maiden” names!
             return I18N::translate('maiden name');
         case 'married':
             switch ($sex) {
                 case 'M':
                     /* I18N: A name taken on marriage - usually the wife takes the husband’s surname */
                     return I18N::translateContext('MALE', 'married name');
                 case 'F':
                     /* I18N: A name taken on marriage - usually the wife takes the husband’s surname */
                     return I18N::translateContext('FEMALE', 'married name');
                 default:
//.........这里部分代码省略.........
开发者ID:tronsmit,项目名称:webtrees,代码行数:101,代码来源:GedcomCodeName.php


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