Public Member Functions | Public Attributes | Protected Member Functions

oxField Class Reference

Collaboration diagram for oxField:

List of all members.

Public Member Functions

 __construct ($value=null, $type=self::T_TEXT)
 __isset ($sName)
 __get ($sName)
 __toString ()
 convertToFormattedDbDate ()
 convertToPseudoHtml ()
 setValue ($value=null, $type=self::T_TEXT)
 getRawValue ()

Public Attributes

const T_TEXT = 1
const T_RAW = 2

Protected Member Functions

 _initValue ($value=null, $type=self::T_TEXT)

Detailed Description

Database field description object.

when a value is requested from oxField, it either takes 'value' field or 'rawValue' (depending which one is available). In case 'rawValue' is taken, it is escaped first before returning.

T_RAW and T_TEXT types represent not the assignment logic, but rather a returned value escaping status.

Definition at line 14 of file oxfield.php.


Constructor & Destructor Documentation

oxField.__construct ( value = null,
type = self::T_TEXT 
)

Constructor Initial value assigment is coded here by not calling a function is for performance because oxField is created MANY times and even a function call matters

if T_RAW is used, then it fills $value, because this is the value, that does not need to be escaped and is by definition equal to $rawValue (which is not set for less memory usage).

if T_TEXT is used, then $rawValue is assigned and retrieved $value (which is not set initially) is escaped $rawValue.

e.g. > if your input is "<b>string</b>" and you want your output to be exactly same, you should use T_RAW - in this way it will be assigned to $value property as the result. > if your input is "1 & (a < b)" and you want your output to be escaped, you should use T_TEXT - in this way it will be assigned to $rawValue property and it will be escaped.

Parameters:
mixed $value Field value
int $type Value type
Returns:
null

Definition at line 51 of file oxfield.php.


Member Function Documentation

oxField.__get ( sName  ) 

Magic getter

Parameters:
string $sName Variable name
Returns:
string | null

Definition at line 94 of file oxfield.php.

oxField.__isset ( sName  ) 

Checks if $name is set

Parameters:
string $sName Variable name
Returns:
boolean

Definition at line 73 of file oxfield.php.

oxField.__toString (  ) 

Returns actual field value

Returns:
string

Definition at line 123 of file oxfield.php.

oxField._initValue ( value = null,
type = self::T_TEXT 
) [protected]

Initial field value

Parameters:
mixed $value Field value
int $type Value type
Returns:
null

Definition at line 156 of file oxfield.php.

oxField.convertToFormattedDbDate (  ) 

Converts to formatted db date

Returns:
null

Definition at line 133 of file oxfield.php.

oxField.convertToPseudoHtml (  ) 

Converts to pseudo html - new lines to
tags

Returns:
null

Definition at line 143 of file oxfield.php.

oxField.getRawValue (  ) 

Return raw value

Returns:
string

Definition at line 188 of file oxfield.php.

oxField.setValue ( value = null,
type = self::T_TEXT 
)

Sets field value and type

Parameters:
mixed $value Field value
int $type Value type
Returns:
null

Definition at line 176 of file oxfield.php.


Member Data Documentation

const oxField.T_RAW = 2

escaping functionality type: expected value is not escaped (raw) text.

Definition at line 24 of file oxfield.php.

const oxField.T_TEXT = 1

escaping functionality type: expected value is escaped text.

Definition at line 19 of file oxfield.php.


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