.

Tristate Class Reference
[Tristate]

Provides tristate logic. More...

List of all members.

Static Public Member Functions

static  get_states ()
  Returns possible states as associative array with DB vlaue as key and localized display value as value.
static  resolve ($tristate, $yes, $no, $unkown)
  Depending on $tristate returns of of the values $yes, $no, or $unkown.

Public Attributes

const  NO = 'FALSE'
const  UNKOWN = 'UNKNOWN'
const  YES = 'TRUE'

Detailed Description

Provides tristate logic.

Since:
0.5.1
Author:
Gerd Riesselmann

Definition at line 10 of file tristate.cls.php.


Member Function Documentation

static Tristate::get_states (  )  [static]

Returns possible states as associative array with DB vlaue as key and localized display value as value.

Returns:
array

Definition at line 20 of file tristate.cls.php.

00020                                             {
00021                 return array(
00022                         self::YES => tr(self::YES, 'tristate'),
00023                         self::NO => tr(self::NO, 'tristate'),
00024                         self::UNKOWN => tr(self::UNKOWN, 'tristate')            
00025                 );
00026         }
static Tristate::resolve ( tristate,
yes,
no,
unkown  
) [static]

Depending on $tristate returns of of the values $yes, $no, or $unkown.

Parameters:
string  $tristate Tristate value
mixed  $yes Value to return if $tristate is Tristate::YES
mixed  $no Value to return if $tristate is Tristate::NO
mixed  $unknown Value to return if $tristate is Tristate::UNKOWN
Returns:
mixed

Definition at line 37 of file tristate.cls.php.

00037                                                                       {
00038                 switch ($tristate) {
00039                         case self::YES:
00040                                 return $yes;
00041                         case self::NO:
00042                                 return $no;
00043                         default:
00044                                 return $unkown;
00045                 }
00046         } 

Member Data Documentation

const Tristate::NO = 'FALSE'

Definition at line 12 of file tristate.cls.php.

const Tristate::UNKOWN = 'UNKNOWN'

Definition at line 13 of file tristate.cls.php.

const Tristate::YES = 'TRUE'

Definition at line 11 of file tristate.cls.php.


The documentation for this class was generated from the following file: