SourceForge.net LogoPHPGallue
[ class tree: libbase ] [ index: libbase ] [ all elements ]

Class: GALVariable

Source Location: /libbase/globalvars.inc.php

Class Overview


Represents a single value.


Variables

Constants

Methods


Child classes:

GALDescriptor
An extension of GALVariable that adds a name property and reading from GET, POST or COOKIE data.

Class Details

[line 29]
Represents a single value.



[ Top ]


Class Variables

$_default =  ""

[line 67]

The default value of this variable.

This value is used if one tries to set this variable to a value that is not within the range given in $range.




Tags:

access:  protected

Type:   mixed


[ Top ]

$_range =  GALVariable::INT

[line 53]

The value range (Wertebereich) of this variable.

Either an array with all valid values or one of GALVariable::INT, GALVariable::UINT, GALVariable::FLOAT or GALVariable::STRING.




Tags:

access:  protected

Type:   mixed


[ Top ]

$_value =  ""

[line 61]

The current value of this variable.

It must be within the range given in $range. I.e. if $range is an array, it must be one of the array's values, and if it's GALVariable::FLOAT, it must be a floating point number. This is assured in set() and check().




Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


method check [line 110]

mixed check( mixed $value)

Checks and filters the given value if it's valid for this variable.

If $value is invalid, the default value is used.




Tags:

return:  The filtered value.
throws:  GAL_EGlobalVars If the range of this variable is invalid.


Parameters:

mixed   $value   The value to check.

[ Top ]

method get [line 99]

mixed get( )

Returns the vlue of this variable.



Tags:

return:  This variable's value.


[ Top ]

method set [line 91]

void set( mixed $value)

Sets the value of this variable.

If the value is invalid, $default is used.




Tags:

throws:  GAL_EGlobalVars If the range of this variable is invalid.


Parameters:

mixed   $value   The new value o this variable.

[ Top ]

constructor __construct [line 75]

GALVariable __construct( mixed $range, mixed $value, mixed $default)

Initializes a GALVariable.



Tags:

throws:  GAL_EGlobalVars.


Overridden in child classes as:

GALDescriptor::__construct()
Initializes a GALDescriptor object.

Parameters:

mixed   $range   Either an array with all valid values, or one of GALVariable::INT, GALVariable::UINT, GALVariable::FLOAT or GALVariable::STRING.
mixed   $value   The initial value of the variable. If it is not valid, the default value ist used.
mixed   $default   The default value. If it's not within the range defined by the $range parameter, a GAL_EGlobalVars is thrown.

[ Top ]


Class Constants

FLOAT =  'float'

[line 42]

indicates a floating point number.


[ Top ]

INT =  'int'

[line 34]

Indicates a signed integer.


[ Top ]

STRING =  'string'

[line 46]

Indicates a string value.


[ Top ]

UINT =  'uint'

[line 38]

Indicates an unsigned integer.


[ Top ]



Documentation generated on Wed, 16 Aug 2006 15:36:06 +0200 by phpDocumentor 1.3.0RC6