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


PHP Default_Model_Countries::getCountryPrintableNameByIso方法代码示例

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


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

示例1: getPublicData

 /**
  * Gets all public data as an array, used in public profile page
  *
  * @author joel peltonen
  * @param id int user whose data we are to get
  * @return array of user data
  */
 public function getPublicData($id = -1)
 {
     if ($id == -1) {
         return false;
         // don't allow default value
     }
     // get only key and value fields, others are not needed
     $select = $this->select()->from($this, array('profile_key_usp', 'profile_value_usp'))->where('id_usr_usp = ?', $id)->where('public_usp = ?', 1);
     // roll to array and return
     $results = $this->fetchAll($select);
     foreach ($results as $result) {
         $collection[$result->profile_key_usp] = htmlentities($result->profile_value_usp);
     }
     // Change gender to M or N
     if (isset($collection['gender']) && $collection['gender'] == 1) {
         $collection['gender'] = 'Male';
     } else {
         if (isset($collection['gender']) && $collection['gender'] == 2) {
             $collection['gender'] = 'Female';
         }
     }
     // Change employment "code" to text
     if (isset($collection['employment'])) {
         $collection['employment'] = $this->getEmploymentByEmployment($collection['employment']);
     }
     // User timezone
     if (isset($collection['usertimezone'])) {
         $timezone_model = new Default_Model_Timezones();
         $collection['usertimezone'] = $timezone_model->getTimezoneTextById($collection['usertimezone']);
     }
     // User country
     if (isset($collection['country'])) {
         $country_model = new Default_Model_Countries();
         $collection['country'] = $country_model->getCountryPrintableNameByIso($collection['country']);
     }
     return $collection;
 }
开发者ID:jaakkop,项目名称:site,代码行数:44,代码来源:UserProfiles.php


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