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


PHP Family::loadFamilyMember方法代码示例

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


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

示例1: formatFamilyMemberElement

 public static function formatFamilyMemberElement($tag, $titleString, $prevFamilyMembers = array())
 {
     // TODO If the family member used to be a child of this family and now it is a spouse of this family, and it has another set of parents,
     // those parents won't appear in this person's spouse element in this family.  Have to include this check in our periodic audit.
     $title = Title::newFromText($titleString, NS_PERSON);
     if ($title) {
         if (isset($prevFamilyMembers[$title->getText()])) {
             $person = $prevFamilyMembers[$title->getText()];
         } else {
             $person = Family::loadFamilyMember($title->getText());
         }
         $result = "<{$tag} title=\"" . StructuredData::escapeXml($title->getText()) . '"';
         foreach (self::$FAMILY_MEMBER_ATTRS as $attr) {
             if (isset($person[$attr]) && !($tag == 'child' && $attr == 'child_of_family')) {
                 $attrValue = trim($person[$attr]);
                 if (strlen($attrValue) > 0) {
                     $result .= " {$attr}=\"" . StructuredData::escapeXml($attrValue) . '"';
                 }
             }
         }
         $result .= "/>\n";
     } else {
         $result = '';
     }
     return $result;
 }
开发者ID:k-hasan-19,项目名称:wiki,代码行数:26,代码来源:Family.php

示例2: formatPageElement

 private function formatPageElement($tag, $titleString, $ns)
 {
     $title = Title::newFromText($titleString, $ns);
     if (!$title) {
         return '';
     }
     $title = StructuredData::getRedirectToTitle($title);
     // ok to read from slave here; mistakes will get corrected in propagate
     if ($ns == NS_PERSON) {
         if (isset($this->prevPeople[$title->getText()])) {
             $page = $this->prevPeople[$title->getText()];
         } else {
             $page = Family::loadFamilyMember($title->getText());
         }
         $attrs = self::$PERSON_ATTRS;
     } else {
         // NS_FAMILY
         if (isset($this->prevFamilies[$title->getText()])) {
             $page = $this->prevFamilies[$title->getText()];
         } else {
             $page = array();
         }
         $attrs = self::$FAMILY_ATTRS;
     }
     $result = "<{$tag} title=\"" . StructuredData::escapeXml($title->getText()) . '"';
     foreach ($attrs as $attr) {
         if (isset($page[$attr])) {
             $attrValue = trim($page[$attr]);
             if (strlen($attrValue) > 0) {
                 $result .= " {$attr}=\"" . StructuredData::escapeXml($attrValue) . '"';
             }
         }
     }
     $result .= "/>\n";
     return $result;
 }
开发者ID:k-hasan-19,项目名称:wiki,代码行数:36,代码来源:SDImage.php


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