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


PHP ca_locales::getName方法代码示例

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


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

示例1: _convertCodeToDisplayText

 /**
  *
  */
 private function _convertCodeToDisplayText($ps_prop, $pa_path_components, $pt_instance, $pa_options = null)
 {
     $vs_prop = $ps_prop;
     $vs_field_name = $pa_path_components['subfield_name'] ? $pa_path_components['subfield_name'] : $pa_path_components['field_name'];
     $vs_table_name = $pa_path_components['table_name'];
     if (method_exists($pt_instance, 'setLabelTypeList')) {
         $pt_instance->setLabelTypeList($this->opo_subject_instance->getAppConfig()->get($pa_path_components['field_name'] == 'nonpreferred_labels' ? "{$vs_table_name}_nonpreferred_label_type_list" : "{$vs_table_name}_preferred_label_type_list"));
     }
     if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && ($vs_list_code = $pt_instance->getFieldInfo($vs_field_name, "LIST_CODE"))) {
         $vs_prop = $this->opt_list->getItemFromListForDisplayByItemID($vs_list_code, $vs_prop);
     } else {
         if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && ($vs_list_code = $pt_instance->getFieldInfo($vs_field_name, "LIST"))) {
             $vs_prop = $this->opt_list->getItemFromListForDisplayByItemValue($vs_list_code, $vs_prop);
         } else {
             if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && $vs_field_name === 'locale_id' && (int) $vs_prop > 0) {
                 $t_locale = new ca_locales($vs_prop);
                 $vs_prop = $t_locale->getName();
             } else {
                 if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && is_array($va_list = $pt_instance->getFieldInfo($vs_field_name, "BOUNDS_CHOICE_LIST"))) {
                     foreach ($va_list as $vs_option => $vs_value) {
                         if ($vs_value == $vs_prop) {
                             $vs_prop = $vs_option;
                             break;
                         }
                     }
                 }
             }
         }
     }
     return $vs_prop;
 }
开发者ID:kai-iak,项目名称:providence,代码行数:34,代码来源:SearchResult.php

示例2: get


//.........这里部分代码省略.........
             case FT_BIT:
                 $vs_prop = isset($this->_FIELD_VALUES[$ps_field]) ? $this->_FIELD_VALUES[$ps_field] : "";
                 if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText']) {
                     $vs_prop = (bool) $vs_prop ? _t('yes') : _t('no');
                 }
                 return $vs_prop;
                 break;
             case FT_TEXT:
             case FT_NUMBER:
             case FT_PASSWORD:
                 $vs_prop = isset($this->_FIELD_VALUES[$ps_field]) ? $this->_FIELD_VALUES[$ps_field] : null;
                 if (isset($pa_options["FILTER_HTML_SPECIAL_CHARS"]) && $pa_options["FILTER_HTML_SPECIAL_CHARS"]) {
                     $vs_prop = htmlentities(html_entity_decode($vs_prop));
                 }
                 //
                 // Convert foreign keys and choice list values to display text is needed
                 //
                 if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && ($vs_list_code = $this->getFieldInfo($ps_field, "LIST_CODE"))) {
                     $t_list = new ca_lists();
                     $vs_prop = $t_list->getItemFromListForDisplayByItemID($vs_list_code, $vs_prop);
                 } else {
                     if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && ($vs_list_code = $this->getFieldInfo($ps_field, "LIST"))) {
                         $t_list = new ca_lists();
                         if (!($vs_tmp = $t_list->getItemFromListForDisplayByItemValue($vs_list_code, $vs_prop))) {
                             if ($vs_tmp = $this->getChoiceListValue($ps_field, $vs_prop)) {
                                 $vs_prop = $vs_tmp;
                             }
                         } else {
                             $vs_prop = $vs_tmp;
                         }
                     } else {
                         if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && $ps_field === 'locale_id' && (int) $vs_prop > 0) {
                             $t_locale = new ca_locales($vs_prop);
                             $vs_prop = $t_locale->getName();
                         } else {
                             if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && is_array($va_list = $this->getFieldInfo($ps_field, "BOUNDS_CHOICE_LIST"))) {
                                 foreach ($va_list as $vs_option => $vs_value) {
                                     if ($vs_value == $vs_prop) {
                                         $vs_prop = $vs_option;
                                         break;
                                     }
                                 }
                             }
                         }
                     }
                 }
                 if (isset($pa_options["CONVERT_HTML_BREAKS"]) && $pa_options["CONVERT_HTML_BREAKS"] || isset($pa_options["convertLineBreaks"]) && $pa_options["convertLineBreaks"]) {
                     $vs_prop = caConvertLineBreaks($vs_prop);
                 }
                 break;
             case FT_DATETIME:
             case FT_TIMESTAMP:
             case FT_HISTORIC_DATETIME:
             case FT_HISTORIC_DATE:
             case FT_DATE:
                 $vn_timestamp = isset($this->_FIELD_VALUES[$ps_field]) ? $this->_FIELD_VALUES[$ps_field] : 0;
                 if ($vb_return_with_structure) {
                     $vs_prop = array('start' => $this->_FIELD_VALUES[$ps_field], 'end' => $this->_FIELD_VALUES[$ps_field]);
                 } elseif (caGetOption('GET_DIRECT_DATE', $pa_options, false) || caGetOption('getDirectDate', $pa_options, false) || caGetOption('rawDate', $pa_options, false)) {
                     $vs_prop = $this->_FIELD_VALUES[$ps_field];
                 } elseif (isset($pa_options['sortable']) && $pa_options['sortable']) {
                     $vs_prop = $vn_timestamp . "/" . $vn_timestamp;
                 } else {
                     $o_tep = new TimeExpressionParser();
                     if ($ps_field_type == FT_HISTORIC_DATETIME || $ps_field_type == FT_HISTORIC_DATE) {
                         $o_tep->setHistoricTimestamps($vn_timestamp, $vn_timestamp);
开发者ID:samrahman,项目名称:providence,代码行数:67,代码来源:BaseModel.php

示例3: _get


//.........这里部分代码省略.........
                                             } elseif (isset($pa_options['returnURL']) && $pa_options['returnURL']) {
                                                 $va_return_values[] = $this->getMediaUrl($va_path_components['table_name'] . '.' . $va_path_components['field_name'], $vs_version, $pa_options);
                                             } else {
                                                 $va_return_values[] = $this->getMediaTag($va_path_components['table_name'] . '.' . $va_path_components['field_name'], $vs_version, $pa_options);
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                         break;
                     default:
                         // is intrinsic field in primary table
                         $vb_supports_preferred = (bool) $t_instance->hasField('is_preferred');
                         foreach ($va_value_list as $vn_id => $va_values_by_locale) {
                             foreach ($va_values_by_locale as $vn_locale_id => $va_values) {
                                 foreach ($va_values as $vn_i => $va_value) {
                                     $va_ids[] = $vn_id = $va_value[$vs_pk];
                                     if ($vb_get_preferred_labels_only && $vb_supports_preferred && !$va_value['is_preferred']) {
                                         continue;
                                     }
                                     if ($vb_get_nonpreferred_labels_only && $vb_supports_preferred && $va_value['is_preferred']) {
                                         continue;
                                     }
                                     $vs_prop = $va_value[$va_path_components['field_name']];
                                     if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && ($vs_list_code = $t_instance->getFieldInfo($va_path_components['field_name'], "LIST_CODE"))) {
                                         $vs_prop = $t_list->getItemFromListForDisplayByItemID($vs_list_code, $vs_prop);
                                     } else {
                                         if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && ($vs_list_code = $t_instance->getFieldInfo($va_path_components['field_name'], "LIST"))) {
                                             $vs_prop = $t_list->getItemFromListForDisplayByItemValue($vs_list_code, $vs_prop);
                                         } else {
                                             if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && $va_path_components['field_name'] === 'locale_id' && (int) $vs_prop > 0) {
                                                 $t_locale = new ca_locales($vs_prop);
                                                 $vs_prop = $t_locale->getName();
                                             } else {
                                                 if (isset($pa_options['convertCodesToDisplayText']) && $pa_options['convertCodesToDisplayText'] && is_array($va_list = $t_instance->getFieldInfo($va_path_components['field_name'], "BOUNDS_CHOICE_LIST"))) {
                                                     foreach ($va_list as $vs_option => $vs_value) {
                                                         if ($vs_value == $vs_prop) {
                                                             $vs_prop = $vs_option;
                                                             break;
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                     if ($vb_return_all_locales) {
                                         $va_return_values[$vn_id][$vn_locale_id][] = $vs_prop;
                                     } else {
                                         $va_return_values[$vn_id][$vn_locale_id] = $vs_prop;
                                     }
                                 }
                             }
                         }
                         if (!$vb_return_all_locales) {
                             $va_return_values = array_values(caExtractValuesByUserLocale($va_return_values));
                         }
                         break;
                 }
             } else {
                 // Attributes
                 $vs_pk = $t_original_instance->primaryKey();
                 $vb_is_related = $this->ops_table_name !== $va_path_components['table_name'];
                 $va_ids = array();
                 $t_instance = $this->opo_datamodel->getInstanceByTableName($va_path_components['table_name'], true);
                 foreach ($va_value_list as $vn_i => $va_values_by_locale) {
开发者ID:ffarago,项目名称:pawtucket2,代码行数:67,代码来源:SearchResult.php


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