MantisBT
[ class tree: MantisBT ] [ index: MantisBT ] [ all elements ]

Class: MantisEnum

Source Location: /core/classes/MantisEnum.class.php

Class Overview


A class that handles MantisBT Enumerations.


Constants

Methods



Class Details

[line 31]
A class that handles MantisBT Enumerations.

For example: 10:lablel1,20:label2




[ Top ]


Class Methods


static method getAssocArrayIndexedByLabels [line 151]

static associate getAssocArrayIndexedByLabels( string $enumString)

Get an associate array for the tuples of the enum where the labels are the array indices and the values are the array values.



Tags:

return:  array indexed by labels.
access:  public


Parameters:

string   $enumString  

[ Top ]

static method getAssocArrayIndexedByValues [line 109]

static associate getAssocArrayIndexedByValues( string $enumString)

Get an associate array for the tuples of the enum where the values are the array indices and the labels are the array values.



Tags:

return:  array indexed by labels.
access:  public


Parameters:

string   $enumString  

[ Top ]

static method getLabel [line 55]

static string getLabel( string $enumString, int $value)

Get the string associated with the $p_enum value



Tags:

access:  public


Parameters:

string   $enumString  
int   $value  

[ Top ]

static method getLocalizedLabel [line 77]

static the getLocalizedLabel( string $enumString, string $localizedEnumString, integer $value)

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.



Tags:

return:  label or the decorated value to represent not found.
access:  public


Parameters:

string   $enumString   The standard enum string.
string   $localizedEnumString   The localized enum string.
integer   $value   The value to lookup.

[ Top ]

static method getValue [line 92]

static integer getValue( string $enumString, string $label)

Gets the value associated with the specified label.



Tags:

return:  value of the enum or false if not found.
access:  public


Parameters:

string   $enumString   The enumerated string.
string   $label   The label to map.

[ Top ]

static method getValues [line 161]

static array getValues( $enumString $enumString)

Gets an array with all values in the enum.



Tags:

return:  of unique values.
access:  public


Parameters:

$enumString   $enumString  

[ Top ]

static method hasValue [line 172]

static bool hasValue( string $enumString, integer $value)

Checks if the specified enum string contains the specified value.



Tags:

return:  true if found, false otherwise.
access:  public


Parameters:

string   $enumString   The enumeration string.
integer   $value   The value to chec,

[ Top ]


Class Constants

TUPLE_SEPARATOR =  ','

[line 40]

Separator that is used to separate the enum tuples within an enumeration definition.


[ Top ]

VALUE_LABEL_SEPARATOR =  ':'

[line 35]

Separator that is used to separate the enum values from their labels.


[ Top ]



Documentation generated on Sun, 12 Dec 2010 23:50:41 +0900 by phpDocumentor 1.4.3
inserted by FC2 system