本文整理汇总了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;
}