示例#1
0
 /**
  * Gets the localized label corresponding to a value.  Note that this method
  * takes in the standard / localized enums so that if the value is in the localized
  * enum but not the standard one, then it returns not found.
  *
  * @param string $enumString The standard enum string.
  * @param string $localizedEnumString  The localized enum string.
  * @param integer $value  The value to lookup.
  *
  * @return the label or the decorated value to represent not found.
  */
 public static function getLocalizedLabel($enumString, $localizedEnumString, $value)
 {
     if (!MantisEnum::hasValue($enumString, $value)) {
         return MantisEnum::getLabelForUnknownValue($value);
     }
     return MantisEnum::getLabel($localizedEnumString, $value);
 }
示例#2
0
 /**
  * Gets the localized label corresponding to a value.  Note that this method
  * takes in the standard / localized enums so that if the value is in the localized
  * enum but not the standard one, then it returns not found.
  *
  * @param string  $p_enum_string           The standard enum string.
  * @param string  $p_localized_enum_string The localized enum string.
  * @param integer $p_value                 The value to lookup.
  *
  * @return string the label or the decorated value to represent not found.
  */
 public static function getLocalizedLabel($p_enum_string, $p_localized_enum_string, $p_value)
 {
     if (!MantisEnum::hasValue($p_enum_string, $p_value)) {
         return MantisEnum::getLabelForUnknownValue($p_value);
     }
     $t_assoc_array = MantisEnum::getAssocArrayIndexedByValues($p_localized_enum_string);
     if (isset($t_assoc_array[(int) $p_value])) {
         return $t_assoc_array[(int) $p_value];
     }
     return MantisEnum::getLabel($p_enum_string, $p_value);
 }