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

Class: MantisEnum

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

Class MantisEnum

Class Overview

A class that handles MantisBT Enumerations.

For example: 10:lablel1,20:label2

Located in /core/classes/MantisEnum.class.php [line 31]



		
		
		
		

Methods

[ Top ]
Constant Summary
TUPLE_SEPARATOR   Separator that is used to separate the enum tuples within an enumeration definition.
VALUE_LABEL_SEPARATOR   Separator that is used to separate the enum values from their labels.

[ Top ]
Method Summary
static associate   getAssocArrayIndexedByLabels()   Get an associate array for the tuples of the enum where the labels are the array indices and the values are the array values.
static associate   getAssocArrayIndexedByValues()   Get an associate array for the tuples of the enum where the values are the array indices and the labels are the array values.
static string   getLabel()   Get the string associated with the $p_enum value
static the   getLocalizedLabel()   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.
static integer   getValue()   Gets the value associated with the specified label.
static array   getValues()   Gets an array with all values in the enum.
static bool   hasValue()   Checks if the specified enum string contains the specified value.

[ Top ]
Methods
static method getAssocArrayIndexedByLabels  [line 139]

  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.

Parameters:
string   $enumString: 

API Tags:
Return:  array indexed by labels.
Access:  public


[ Top ]
static method getAssocArrayIndexedByValues  [line 103]

  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.

Parameters:
string   $enumString: 

API Tags:
Return:  array indexed by labels.
Access:  public


[ Top ]
static method getLabel  [line 49]

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

Get the string associated with the $p_enum value

Parameters:
string   $enumString: 
int   $value: 

API Tags:
Access:  public


[ Top ]
static method getLocalizedLabel  [line 71]

  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.

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

API Tags:
Return:  label or the decorated value to represent not found.
Access:  public


[ Top ]
static method getValue  [line 86]

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

Gets the value associated with the specified label.

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

API Tags:
Return:  value of the enum or false if not found.
Access:  public


[ Top ]
static method getValues  [line 149]

  static array getValues( $enumString $enumString  )

Gets an array with all values in the enum.

Parameters:
$enumString   $enumString: 

API Tags:
Return:  of unique values.
Access:  public


[ Top ]
static method hasValue  [line 160]

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

Checks if the specified enum string contains the specified value.

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

API Tags:
Return:  true if found, false otherwise.
Access:  public


[ Top ]
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, 05 Apr 2009 23:01:23 +0100 by phpDocumentor 1.4.1