本文整理汇总了PHP中TTi18n::getCurrencySymbol方法的典型用法代码示例。如果您正苦于以下问题:PHP TTi18n::getCurrencySymbol方法的具体用法?PHP TTi18n::getCurrencySymbol怎么用?PHP TTi18n::getCurrencySymbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTi18n
的用法示例。
在下文中一共展示了TTi18n::getCurrencySymbol方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSymbol
function getSymbol()
{
return TTi18n::getCurrencySymbol($this->getISOCode());
}
示例2: getObjectAsArray
function getObjectAsArray($include_columns = NULL, $permission_children_ids = FALSE)
{
$variable_function_map = $this->getVariableToFunctionMap();
if (is_array($variable_function_map)) {
foreach ($variable_function_map as $variable => $function_stub) {
if ($include_columns == NULL or isset($include_columns[$variable]) and $include_columns[$variable] == TRUE) {
$function = 'get' . $function_stub;
switch ($variable) {
case 'type':
$function = 'get' . $variable;
if (method_exists($this, $function)) {
$data[$variable] = Option::getByKey($this->{$function}(), $this->getOptions($variable));
}
break;
case 'wage_group':
case 'first_name':
case 'last_name':
case 'title':
case 'user_group':
case 'currency':
case 'default_branch':
case 'default_department':
$data[$variable] = $this->getColumn($variable);
break;
case 'currency_symbol':
$data[$variable] = TTi18n::getCurrencySymbol($this->getColumn('iso_code'));
break;
case 'effective_date':
if (method_exists($this, $function)) {
$data[$variable] = TTDate::getAPIDate('DATE', $this->{$function}());
}
break;
default:
if (method_exists($this, $function)) {
$data[$variable] = $this->{$function}();
}
break;
}
}
}
$this->getPermissionColumns($data, $this->getID(), $this->getCreatedBy(), $permission_children_ids, $include_columns);
$this->getCreatedAndUpdatedColumns($data, $include_columns);
}
return $data;
}
示例3: getEncoding
function getEncoding($company_id = FALSE)
{
if ($company_id == '') {
$company_id = $this->getID();
}
$cache_id = 'encoding_' . $company_id;
$retval = $this->getCache($cache_id);
if ($retval === FALSE) {
if ($retval === FALSE) {
//Get unique currencies, to check if currency symbol requires unicode.
$clf = TTnew('CurrencyListFactory');
$iso_codes = $clf->getUniqueISOCodeByCompanyId($company_id);
//Debug::Arr($iso_codes, 'ISO Codes: ', __FILE__, __LINE__, __METHOD__,9);
if (is_array($iso_codes)) {
foreach ($iso_codes as $iso_code) {
$encoding = strtoupper(mb_detect_encoding(TTi18n::getCurrencySymbol($iso_code), 'auto'));
if ($encoding == 'UTF-8') {
Debug::Text($encoding, 'ISO Code: ' . $iso_code . ' Encoding: ' . $encoding, __FILE__, __LINE__, __METHOD__, 9);
$retval = 'UTF-8';
}
}
}
}
if ($retval === FALSE) {
//Get unique language codes, if anything other than english is used, assume UTF-8.
$uplf = TTnew('UserPreferenceListFactory');
$language_codes = $uplf->getUniqueLanguageByCompanyId($company_id);
//Debug::Arr($language_codes, 'Language Codes: ', __FILE__, __LINE__, __METHOD__,9);
if (is_array($language_codes)) {
foreach ($language_codes as $language_code) {
if ($language_code != 'en') {
$retval = 'UTF-8';
}
}
}
}
if ($retval === FALSE) {
$retval = 'ISO-8859-1';
}
$this->saveCache($retval, $cache_id);
}
return $retval;
}